(mapcar (lambda (args)
(format t "~%Call with ~S~%" args)
(apply (lambda (&optional (a 2 ap) (c 3 cp) &rest x)
(format t "The caller ~:[didn't~;did ~] provide an argument for A~%" ap)
(format t "The value bound to the parameter A is ~S~%" a)
(format t "The caller ~:[didn't~;did ~] provide an argument for C~%" cp)
(format t "The value bound to the parameter C is ~S~%" c)
(format t "The caller ~:[didn't provide any other argument~;did provide other arguments: ~:*~S~]~%" x)
(list a ap c cp x))
args))
'( ()
(2 3)
(10)
(10 11)
(10 11 12)
(10 11 12 13)))
Call with NIL
The caller didn't provide an argument for A
The value bound to the parameter A is 2
The caller didn't provide an argument for C
The value bound to the parameter C is 3
The caller didn't provide any other argument
Call with (2 3)
The caller did provide an argument for A
The value bound to the parameter A is 2
The caller did provide an argument for C
The value bound to the parameter C is 3
The caller didn't provide any other argument
Call with (10)
The caller did provide an argument for A
The value bound to the parameter A is 10
The caller didn't provide an argument for C
The value bound to the parameter C is 3
The caller didn't provide any other argument
Call with (10 11)
The caller did provide an argument for A
The value bound to the parameter A is 10
The caller did provide an argument for C
The value bound to the parameter C is 11
The caller didn't provide any other argument
Call with (10 11 12)
The caller did provide an argument for A
The value bound to the parameter A is 10
The caller did provide an argument for C
The value bound to the parameter C is 11
The caller did provide other arguments: (12)
Call with (10 11 12 13)
The caller did provide an argument for A
The value bound to the parameter A is 10
The caller did provide an argument for C
The value bound to the parameter C is 11
The caller did provide other arguments: (12 13)
--> ((2 NIL 3 NIL NIL)
(2 T 3 T NIL)
(10 T 3 NIL NIL)
(10 T 11 T NIL)
(10 T 11 T (12))
(10 T 11 T (12 13)))
--
__Pascal Bourguignon__
http://www.informatimago.com/
A bad day in () is better than a good day in {}.