Hacker News new | past | comments | ask | show | jobs | submit login

> They needed a data interchange format and I assume it made more sense to use Clojure's primitives than parsing up JSON.

Even in JavaScript it's better to parse JSON instead of eval'ing, because you don't want to execute stuff that would "happen" to be contained in the data interchange format.




The word REPL comes from lisp and means Read Eval Print Loop. The significance is that unlike in, say, python, Read and Eval are separate. Read reads a string and turns it into an in-memory data structure, Eval takes a data structure (not a string!) and evaluates it.

Using Read in a lisp is typically safe, so long as you turn off reader macros and the like.


> The significance is that unlike in, say, python, Read and Eval are separate.

They are separate:

    * http://docs.python.org/library/ast.html#ast.parse
    * http://docs.python.org/library/ast.html#ast.literal_eval


They aren't evaluated in Clojure, they are read by the reader.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: