diff options
Diffstat (limited to 'list-functions-2.lisp')
-rw-r--r-- | list-functions-2.lisp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/list-functions-2.lisp b/list-functions-2.lisp index c8d4ccd..1c99a4e 100644 --- a/list-functions-2.lisp +++ b/list-functions-2.lisp @@ -84,8 +84,14 @@ (cons (apply function (mapcar1 'car lists)) (apply 'mapcar (list* function (mapcar1 'cdr lists))))))) +(defun maplist (function list &rest more-lists) + (let ((lists (list* list more-lists))) + (when (every1 'identity lists) + (cons (apply function lists) + (apply 'maplist (list* function (mapcar1 'cdr lists))))))) + (defun mapcan (function list &rest more-lists) (%append (apply 'mapcar (list* function list more-lists)))) (defun mapcon (function list &rest more-lists) - (apply (function mapcan) (list* function list more-lists))) + (%append (apply 'maplist (list* function list more-lists)))) |