Plaster
New
List
Login
common-lisp
default
anonymous
2024.12.04 07:30:50
(defun map-apply (fun &rest lists) (apply #'mapcar (lambda (&rest args) (apply fun (apply #'nconc args))) lists)) (define-compiler-macro map-apply (&whole form fun &rest lists) (if (= (list-length lists) 1) `(mapcar (lambda (args) (apply ,fun args)) ,(car lists)) form)) (format t "~A~%" (map-apply #'+ '((0 1) (2 3)))) (format t "~A~%" (map-apply #'+ '((0 1) (2 3)) '((1) (1))))
Raw
Annotate
Repaste
Edit