News for hackers. Stuff that matters.
Re:Little Lisp interpreter by tsm on Tuesday May 26, 2015 @04:24PM (#9607395)

    var tokenize = function(input) {
         return replace(/\(/g, ' ( ')
               .replace(/\)/g, ' ) ')
               .trim()
               .split(/\s+/);
       };
Code like this makes me a little upset. It'll completely break on simple cases: `(print "To close the REPL, type (quit).")` being an obvious example.

I get that it's a toy example, but all too often it slides into tricking people that hard* problems are trivial.

* - I'm aware that tokenization has been a solved problem for decades—what I'm trying to say is that it takes quite a bit more thought than the four-line implementation suggests.

Re:Little Lisp interpreter by dopamean on Tuesday May 26, 2015 @04:27PM (#9607424)
The whole article is pretty poorly thought out. It is supposed to be an about Lisp but doesn't even mention quote...
Re:Little Lisp interpreter by baddox on Tuesday May 26, 2015 @05:53PM (#9607928)
It is supposed to be a little Lisp. At least one thing was bound to be left out.
Re:Little Lisp interpreter by breadbox on Tuesday May 26, 2015 @07:58PM (#9608447)
Yeah, but leaving out "quote" is like leaving "if" out of C.