set-repl-prompt

clojure.contrib.repl-ln

  • (set-repl-prompt)
  • (set-repl-prompt prompt-fmt)
Sets the repl prompt. Include the following codes in the prompt to make
the corresponding dynamic values part of it:

%S - repl serial number
%T - thread id
%D - nesting depth in this thread
%L - input line number
%N - namespace name

With no arguments, resets the repl pompt to its default: "%S:%L %N=> "

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/repl_ln.clj:180 top

(defn set-repl-prompt
  "Sets the repl prompt. Include the following codes in the prompt to make
  the corresponding dynamic values part of it:

    %S - repl serial number
    %T - thread id
    %D - nesting depth in this thread
    %L - input line number
    %N - namespace name

  With no arguments, resets the repl pompt to its default: \"%S:%L %N=> \""
  ([]
     (set-repl-prompt (+info-defaults+ :prompt-fmt)))
  ([prompt-fmt]
     (update *info* :prompt-fmt prompt-fmt)
     (loop [[[code fmt] & more] (seq +prompt-formats+)
            prompt-fmt prompt-fmt]
       (if code
         (recur more (.replace prompt-fmt code fmt))
         (update *private* :prompt-fmt prompt-fmt)))
     nil))
Vars in clojure.contrib.repl-ln/set-repl-prompt: defn loop
Used in 0 other vars

Comments top

No comments for set-repl-prompt. Log in to add a comment.