Next: SRFI-39, Previous: SRFI-19, Up: SRFI Support
This is an implementation of SRFI-26: Notation for specializing parameters without Currying (also known as “curry-which-is-not-curry”).
Expand to a procedure that specializes
slotandslots, if they are the special symbol<>or<...>. The latter can only appear as the last element ofslots. Elements that are neither of these special symbols are evaluated at run-time in their respective positions.
Expand to a procedure that specializes
slots, if they are the special symbol<>or<...>. The latter can only appear as the last element ofslots. Elements that are neither of these special symbols are evaluated at expansion-time in their respective positions.
Here are the examples given in the SRFI 26 specification:
(cut cons (+ a 1) <>) === (lambda (x2) (cons (+ a 1) x2))
(cut list 1 <> 3 <> 5) === (lambda (x2 x4) (list 1 x2 3 x4 5))
(cut list) === (lambda () (list))
(cut list 1 <> 3 <...>) === (lambda (x2 . xs) (apply list 1 x2 3 xs))
(cut <> a b) === (lambda (f) (f a b))
(cute cons (+ a 1) <>) === (let ((a1 (+ a 1)))
(lambda (x2) (cons a1 x2)))