|
I do not know Haskell enough to fully judge this, so maybe someone can correct me, but that seems _very_ minimal. From what I understand, it doesn't even have arithmetic operations, it "executes" incorrect programs without any error (try repl "())") and also it doesn't have any kind of scoping, for example in the following code a function argument is bound in the global (and only) environment: Main> repl "(begin ((fun (x y) y) 1 2) y)" ([("x",Number 1),("y",Number 2),("begin",Fun),("car",Fun),("cdr",Fun),("cons",Fun),("cond",Fun),("def",Fun),("eval",Fun),("fun",Fun),("t",Symbol "t"),("quote",Fun)],Number 2) I don't think it's fair to call this a Lisp at all at this point. There is a nice writeup of implementing a Lisp in Python by Peter Norvig, where at least the most basic things are implemented correctly (and the code is documented): http://norvig.com/lispy.html Also, I get errors even with some very simple statements that theoretically seem to be implemented like: Main> repl "(cons 1 2)" ([("begin",Fun),("car",Fun),("cdr",Fun),("cons",Fun),("cond",Fun),("def",Fun),("eval",Fun),("fun",Fun),("t",Symbol "t"),("quote",Fun)],List [Exception: lisp.hs:48:8-48: Irrefutable pattern failed for pattern (ctx', [v', (Main.List vs')]) Am I doing something wrong here? |