|
|
|
|
|
by kazinator
1869 days ago
|
|
You have a strawman example of piping via .member() because those () sometimes have arguments; that's what they are there for. Function application has not gone away; it's just combined with obj.member access. It can easily become an unreadable mess that will need some way of splitting across lines and indenting: something.first(other.foo(bar.f(x, y)).memb, z).second(x.y()).third(a, b, c)
This: (third
(second
(first
(something))))
is just function notation with the location of the opening parenthesis having been re-examined, and commas removed. Function application notation is found in a myriad languages: sin(cos(pow(x, 2))).With the above indentation, it's very readable to me; it's very clear that calculation starts with (something) and moves in an outward direction. (-> something first second third)
Right, yes, so we have threading macros, and people use them. That's not all that goes left to right. Lisp's ancient progn (including implicit progn) goes left to right, as do the arguments of functions and most macros: (defun app ()
(init)
(event-loop)
(cleanup)
(exit 0))
Sequential binding can break up a nested "point-free" expression, as an alternative to threading: (let* ((a (first (something)))
(b (second fi))
(c (third se))
...)
|
|
Most aren't fond of Lisp syntax, regardless of how you dress it up, and thus writing in Lisps doom you to have fewer people to hand over your code to, and I don't think that scarcity is useful. I suspect the reason most don't like s-expression is that it forces the human reader to maintain a "mental stack", an exercise humans are not too good at, as demonstrated by human languages aversion of center embeddings.