Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Pipable functions in C++14. Parent comment
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.
There are no comments on this comment yet.
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.