3 ms·
In this linked document for Magritte, it describes its pipeline operator in a section called "Syntax Design - Linear Composition: Why Not Lisp?". ..The problem
by lioeters 7y ago
In this linked document for Magritte, it describes its pipeline operator in a section called "Syntax Design - Linear Composition: Why Not Lisp?".
..The problem is the prefix-only calling convention that requires a back-and-forth movement of the cursor, and causes the expression to expand leftwards, opposite of the direction of the user’s typing.
While some languages have some support for linear composition using operators such as Clojure’s arrow macros or OCaml’s |> operator, the integration of these macros with the underlying subsystem is shallow.
I question this last statement.
Just this weekend I was reading about Hy's (based on Clojure's) threading macros:
"Threading macros, also known as arrow macros, convert nested function calls into a linear flow of function calls"
-> (or the threading macro) is used to avoid nesting of expressions. The threading macro inserts each expression into the next expression’s first argument place.
->> (or the threading tail macro) is similar to the threading macro, but instead of inserting each expression into the next expression’s first argument, it appends it as the last argument.
At least to me this seems far from "shallow" and even more useful/flexible than the pipeline operator.
- usgroup 7y agoYeah basically. As a ex Clojure user, I’d agree. It’s not shallow and if one finds it shallow then one can write their own macro to be less shallow.
- lioeters 7y agoAs I'm educating myself on Lispy languages, may I ask why the "ex" for Clojure and what (if any) other language you've moved onto?
- usgroup 7y agoI've always used many languages, but I tried clojure for data processing stuff. I moved away from it because the number of libraries was tiny; I had to write my own libraries for doing basic SQLy things. Some hard things were easy in Clojure, but too many easy things were hard.
- lioeters 7y agoThanks! That was interesting to hear about your experience with Clojure. I've heard good things about the language, reading here and there about its features and strengths - so I was curious to know if there were any critiques/cons (pun intended :).