3 ms·
> they can't distinguish between calling (foo 1 (+ 1 2) (+ 3 4)) and calling (foo 1) (+ 1 2) (+ 3 4). The former is encoded as > foo 1 (+ 1 2) (+ 3 4) and
by kazinator 3y ago
> they can't distinguish between calling (foo 1 (+ 1 2) (+ 3 4)) and calling (foo 1) (+ 1 2) (+ 3 4).
The former is encoded as
> foo 1 (+ 1 2) (+ 3 4)
and the latter is three separate top-level forms, encoded as
> foo 1
> + 1 2
> + 3 4
Here it looks as if I'm assuming we have one-liners, but that doesn't have to be so; there could be a way to insert soft line breaks that don't dispatch the expression:
> foo 1
(+ 1 2)
(+ 3 4)
> foo 1
> + 1
2
> + 3
4
You do have to restrict the input to one form. Whereas a REPL which uses regular notation can handle a single input line of (foo 1) (+ 1 2), and do two evaluations, we cannot have that here. This style of REPL basically inserts parentheses for you, and it inserts one set of them around your whole input, which makes it a single form.
- amno 3y agoYes, well that is basically what I meant. I guess in practice, those examples I made are contrived, so I suppose what they do is not a problem for the most people in practice, so I don't think it is a big argument against.