by MathMonkeyMan · 3y ago · 0 comments
Racket, a scheme-based language, extended the syntax so that any symbol appearing between two periods and not at the end of a list gets moved to the head of the list, so (a . b . c) becomes (b a c), which some people use so that (a . + . b) becomes (+ a b).
The D syntax you describe is what schemes call the "threading macro," or the thrush combinator in non-macro contexts.
FWIW it's mostly used for inequalities like `(a . <= . b)` which some people find easier to read than `(<= a b)`.
But `<=` allows more arguments as in `(<= a b c d)` and here the double dot notation can't be used.