orangeduck/BuildYourOwnLisp

Function defintions

lewismj opened this issue · 2 comments

Hi,
Not sure if I'm doing something wrong, but was following this project through (just bought the book),
but I get this when trying to define functions (see below), always 'Unbound Symbol' ... any ideas?

Lispy Version 0.0.0.0.7
Press Ctrl+c to Exit

lispy> def {add-together} (\ {x y} {+ x y})
Error: Unbound Symbol '\'
lispy> def {add-together} (\\ {x y} {+ x y})
Error: Unbound Symbol '\\'

I resolved the above issue by compiling the last version in 'strings.c' , it may be my Mac/editline version,
But does the input processing need to change, so that we can have multi-line input, e.g. If I just cut-paste:

(fun {do & l} {
  if (== l nil)
    {nil}
    {last l}
})

I get errors, but not if, I push onto one line.

Yes the prompt only works when you input everything on one line.