From: David Vazquez Date: Sat, 22 Dec 2012 19:54:38 +0000 (+0000) Subject: multivariadic append X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=0f55a4733a01c3288fbc72f83d6138502110c1bb;p=jscl.git multivariadic append --- diff --git a/test.lisp b/test.lisp index 2333621..173b814 100644 --- a/test.lisp +++ b/test.lisp @@ -94,12 +94,15 @@ x (list x))) -(defun append (list1 list2) +(defun append-two (list1 list2) (if (null list1) list2 (cons (car list1) (append (cdr list1) list2)))) +(defun append (&rest lists) + (!reduce #'append-two lists '())) + (defun reverse-aux (list acc) (if (null list) acc