Hi everybody. Can't we use the [+ _ 3] syntax for currying? If we re-interpret [fn-name arg1 ... argn] as (curry fn-name arg1 ... argn) as define curry as something like: (defun combine (curry-args call-args)
(let* ((args (mapcar #'(lambda (x)
(if (eq '_ x) (pop call-args) x))
curry-args)))
(append args call-args)))
(defun curry (fn &rest curry-args)
#'(lambda (&rest call-args)
(apply fn (combine curry-args call-args))))
(please excuse use of Common Lisp and possibly bad style, I'm currently learning all this...)- [/ _ 2] would mean the same as before - [foo _ _] would get different meaning, this a downside, but perhaps not that bad - [+ 3 _] can be written as [+ 3] - (= map-inc [map [+ 1]]) is possible - (funcall [foo _ 2 _ 4] 1 3 5 6) is (foo 1 2 3 4 5 6) What do you think? Marius |