This allows direct children of top-level(comment ) expressions to be run in the REPL (a common practice in other editors).
This allows test/exploratory code to remain commented out, but be easily runnable in the REPL. This is especially important when namespaces get reloaded.
Examples, where | indicates where the cursor is when the proto-repl:execute-top-block command is executed:
(comment
;; this will be printed
(println | "a"))
(comment
(comment
;; this will NOT be printed, because the direct child of the first comment is itself a comment
(println | "a")))
(do
(comment
;; this will NOT be printed, because the comment is not a top-level element
(println | "a")))
(comment
;; this will be printed
(println | "a")
;; these will not be printed because they are separate, direct children of 'comment'
(println "b")
(println "c"))
This allows direct children of top-level
(comment )
expressions to be run in the REPL (a common practice in other editors).This allows test/exploratory code to remain commented out, but be easily runnable in the REPL. This is especially important when namespaces get reloaded.
Examples, where
|
indicates where the cursor is when theproto-repl:execute-top-block
command is executed: