3 ms·
Wow, I thought (setq foo (1 2 3)) was a typo because the inner literal list is not quoted. Strangely, a list with the first element being a number auto-quotes t
by mark_l_watson 9y ago
Wow, I thought (setq foo (1 2 3)) was a typo because the inner literal list is not quoted. Strangely, a list with the first element being a number auto-quotes the whole list.
I have been a heavy Lisp user since the the late 1970s and I don’t recall seeing this before.
That said, picolisp is cool. I just installed it in 10 seconds. BTW, it does not include a read line clone, so alias picolisp to wrap it in wlwrap.
- angus-g 9y agoIt's not quite readline, but if you start the interpreter as `pil +', you get better editing and history and some nice things like `(doc 'sym)'
- girzel 9y agoThat seems like an awful convenience -- isn't it far easier to recall that all lists must be quoted, than to remember which are auto-quoted under which circumstances?
- deleted 9y ago[deleted]
- kencausey 9y agoDid you mean rlwrap rather than wlwrap?
- mark_l_watson 9y agoyes I did thanks for the correction
- rurban 9y agoThis forbids any numeric function names. But ok, the trick is nice.
- kazinator 9y agoThat could be a backward-compatible extension in any mainstream Lisp, because the form (1 ...) is otherwise invalid.
- kbp 9y agoInterestingly, in PicoLisp, if the car of a list evaluates to a number (but isn't a literal), it's taken to be the address of an fsubr (this is how all of the builtins are implemented; if you evaluate their symbols, you'll see they're bound to integers). If you want to do this with a literal number, you have to quote it, like ('1 2 3)