technoblogy / ulisp-arm

A version of the Lisp programming language for ARM-based boards.
http://www.ulisp.com/
MIT License
97 stars 30 forks source link

(lambda x x) loops forever #32

Closed rmu75 closed 3 years ago

rmu75 commented 3 years ago

I think a more sensible behaviour is possible. Either error or do like in scheme (bind x to the list of arguments):

((lambda x x) 1 2 3))
=> (1 2 3)
technoblogy commented 3 years ago

Thanks! I think I should do what Common Lisp does and give an error.

technoblogy commented 3 years ago

By the way, uLisp can bind to the list of arguments using &rest:

> ((lambda (&rest x) x) 1 2 3)
(1 2 3)