<cl> (defun test (a &optional b &rest c) (list a b c)) test <cl> (test 1) (1 NIL NIL) <cl> (test 1 2) (1 2 NIL) <cl> (test 1 2 3) (1 2 (3)) <cl> (test 1 2 3 4) (1 2 (3 4))
<cl> (defun cons* (&key ((:car x) 1) ((:cdr y) 2)) (cons x y)) CONS* <cl> (cons* :cdr 4) (1 . 4) <cl> (cons* (car '(:cdr :cddr)) 3) (1 . 3) <cl> (cons* :car 5) (5 . 2) <cl> (cons* :cdr 4 :car 3) (3 . 4) <cl> (cons* :car 3 :cdr 4) (3 . 4) <cl> (cons*) (1 . 2) <cl> (cons* 3 4) Error: Attempt to access the package field of 3 which is not a symbol. [1] <cl> :resetまた,仮引数ではない局所変数を設けるために&auxをつけた変数をおくとい う方法もあります.