Quantcast
Channel: Hacker News 50
Viewing all articles
Browse latest Browse all 9433

Learning Clojure: Clojure's Reader is Unsafe

$
0
0

Comments:"Learning Clojure: Clojure's Reader is Unsafe"

URL:http://www.learningclojure.com/2013/02/clojures-reader-is-unsafe.html#post-body-2898830171141471587


;; We've got a function, read-string, which can turn strings into data structures while doing no harm whatsoever,
;; and another function, read-string, which can turn strings into data structures while potentially causing arbitrary side effects depending on the content of the strings.

Not quite. There is no -spoon- read-string. As you pointed out, there's:

clojure.tools.reader.edn/read-string and
clojure.core/read-string

The namespace is part of the function's "identity" if you will. I'm sure you're aware of this, but not all of your visitors from HN will be.

ReplyDelete

Viewing all articles
Browse latest Browse all 9433

Trending Articles