cut
macro is defined in SRFI-26.
Using this macro, you can write:
(cut + 3 <>)
which is equivalent to:
(lambda (x) (+ 3 x))
However, when putting <>
inside the the child parens, it won't work.
(cut + 3 (* 2 <>))
Chicken Scheme interpreter terminates with the following error when we try to apply it.
Error: bad argument count - received 1 but expected 0: #<procedure (?)>
I wan't it to be equivalent to:
(lambda (x) (+ 3 (* 2 x)))
Is there any syntax sugar that I can shorten the above code in Chicken Scheme?