Why does the following is not work? That is why does it throw an exception?:
(comment
Replicate a Sequence
http://www.4clojure.com/problem/33
(= (__ [1 2 3] 2) '(1 1 2 2 3 3))
)
Replace the url with another string and it seems to be ok.
(comment
Replicate a Sequence
replace the url and all is well. why
(= (__ [1 2 3] 2) '(1 1 2 2 3 3))
)
Because the url is not a valid token:
Clojure> http://www.4clojure.com/problem/33
java.lang.RuntimeException: Invalid token: http://www.4clojure.com/problem/33
Whereas the other string you had can be read as Clojure forms:
Clojure> (quote (replace the url and all is well. why))
(replace the url and all is well. why)
That is, Clojure can't parse the first example, regardless of whether it's in a (comment ...)
.
For completeness, note that the url is fine with a ;
comment:
Clojure> 3 ; http://www.4clojure.com/problem/33
3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With