3 ms·
You can get lisp to interact more like a console language. Write a parser to accept python-ish whitespace syntax (whilst still allowing parens syntax), and tran
by cturner 14y ago
You can get lisp to interact more like a console language. Write a parser to accept python-ish whitespace syntax (whilst still allowing parens syntax), and transform that s-expressions so you can pass to the interpreter
To imply:
(define (fn a b)
(list (car a) (car (car b))))
You could type:
define: fn a b
list:
car a
car (car b)
As it's a console, in practice you'll mostly be typing commands like this:
load x y z
but you have good mechanisms for going deeper. And if you just want to write in s-expressions you still can.
- akkartik 14y agoI actually have a toy interpreter that does this: http://github.com/akkartik/wart#readme http://github.com/akkartik/wart#readme
- silentbicycle 14y agoThe aside in the linked article about avoiding shifting and parens just to type a simple command is even more true once a command spans multiple lines. Say what you will about syntactic attempts to remove the parens from Lisp, I think it's a secondary issue for a command language. There are some good observations about design pressures on command languages vs. programming languages in Olin Shivers's "A Scheme Shell", as well.