From 0f55a4733a01c3288fbc72f83d6138502110c1bb Mon Sep 17 00:00:00 2001 From: David Vazquez Date: Sat, 22 Dec 2012 19:54:38 +0000 Subject: [PATCH] multivariadic append --- test.lisp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 1.7.10.4