Created
December 23, 2010 06:44
-
-
Save amalloy/752664 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; This is how namespaces are serialized to a string | |
clojail.core> (print-dup *ns* *out*) | |
#=(find-ns clojail.core)nil | |
;; This is how they're printed normally | |
clojail.core> (eval `(println ~*ns*)) | |
#<Namespace clojail.core> | |
nil | |
;; Sensibly, you can't deserialize a namespace when read-eval is false | |
clojail.core> (binding [*read-eval* false] (eval `(println ~*ns*))) | |
; Evaluation aborted. | |
;; But why doesn't this work? Shouldn't ~ns expand | |
;; into (find-ns clojail.core) *before* read-eval is disabled? | |
clojail.core> (let [code `(println ~*ns*)] | |
(binding [*read-eval* false] | |
(eval code))) | |
; Evaluation aborted. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment