5 ms·
Just because you can use some ambiguous syntax construct does not make it good or even clever. This sort of thing can be done a lot clear with functional const
by Guthur 12y ago
Just because you can use some ambiguous syntax construct does not make it good or even clever.
This sort of thing can be done a lot clear with functional constructs like compose and curry.
Common Lisp example (easily done with any language that supports higher order functions):
(funcall (compose 'add-one 'add-one) 1)
And you can roll that a number of ways; adding in a curry of the identity of 1 if you just want a nullary function.
(funcall (compose 'add-one 'add-one (curry 'identity 1))
And if you are interested in typing less, maybe you are a dreadful typist...try Haskell.