4 ms·
"I have no idea why Lisp doesn't let you call functions like foo(1 2 3) ...If it looks confusing, don't write it that way. Just like every other language fea
by akkartik 9y ago
"I have no idea why Lisp doesn't let you call functions like
foo(1 2 3)
...If it looks confusing, don't write it that way. Just like every other language feature."
I used a similar ethos to create a whitespace-sensitive lisp with infix operators without compromising macros. The rule for whitespace-sensitivity was: if whitespace sensitivity was even slightly ambiguous, you lost it. Inside parens you lost it. Inside macros, you lost it. But it was still useful in a wide variety of situations: https://github.com/akkartik/wart/blob/master/004optional_parens https://github.com/akkartik/wart/blob/master/004optional_par...
However, when it came to foo(1 2 3) I ended up just saying no. It has absolutely no benefit except being familiar to non-lispers (where whitespace sensitivity actually makes Lisp easier to read for anyone outside an editor). Particularly if you permit infix, (foo 1 2) and (1 + 2) have a nice correspondence in syntax. Function calls just become a form of prefix operator. More details: http://arclanguage.org/item?id=16924 http://arclanguage.org/item?id=16924 (particularly the last couple of paragraphs)
I think a lot of the reason lispers look down at attempts to make indentation significant is that it's been bundled in the past with other syntax sugars to make Lisp more familiar to non-lispers. The goal shouldn't be familiarity, it should be power.
More details on the infix syntax I designed: http://akkartik.name/post/wart http://akkartik.name/post/wart