3 ms·
Most Lisps (incl. clojure), Scala, and probably others also allow placed or numbered "holes", so something like: 42 |> f 3 would be the same as 42 |> f 3 _
by thelazydogsback 6y ago
Most Lisps (incl. clojure), Scala, and probably others also allow placed or numbered "holes", so something like:
42 |> f 3
would be the same as
42 |> f 3 _
but you could do:
42 |> f _ 3
to get at the first arg.
or even to swap args:
42,43 ||> f %1 %0
which would essentially get expanded to:
42,43 |> fun a b -> f b a
(Of course, in this case the closure should get erased by the optimizer to simply "f 43 42".)
I really miss not having this in F# (and C# for that matter)