3 ms·
Yes, many languages support something eqivalent. Classically object oriented languages not the least: a.h().g().f() I feel that prefix notation is one of the
by zosima 14y ago
Yes, many languages support something eqivalent. Classically object oriented languages not the least:
a.h().g().f()
I feel that prefix notation is one of the greatest impediment to the uptake of Lisps. And I think it's important to underscore that you can (idiomatically) choose prefix, postfix or infix depending on the character of your problem.
If the code is (unnecessarily) hard to read, then express it differently. The language encourages it.
- mryall 14y agoActually the equivalent of the above Perl 6 code would be: f(g(h(a))) It can get kind of gnarly when any of the values are non-trivial.
- zosima 14y agoTranslated directly, yes. But when you have objects and no piping operator, library designers will often choose to implement pipe flow as method chaining. See e.g. jQuery, Scala's collections or many ORMs, like SQLAlchemy.