From: Bernhard Pfahringer
Subject: Re: argument passing: defaults
Date: 
Message-ID: <608184$lmg$1@ftp.univie.ac.at>
In article <·············@WINTERMUTE.eagle>,
SDS  <···········@cctrading.com> wrote:
>(defun zz (&optional (a t)) (format t "zz: a: ~a~%" a))
>(defun xx (&optional a) (format t "xx: a: ~a~%" a) (zz a))
>(xx)
>xx: a: nil
>zz: a: nil
>nil
>
>xx like (if a (zz a) (zz))?
>
This kludge wont help with (xx nil), but the following will:

(defun xx (&optional (a nil a-supplied?))
   (format t "xx: a: ~a~%" a)
   (if a-supplied?
       (zz a)
       (zz)))

(xx)
xx: a: NIL
zz: a: T

(xx nil)
xx: a: NIL
zz: a: NIL
-- 
--------------------------------------------------------------------------
Bernhard Pfahringer
Austrian Research Institute for  http://www.ai.univie.ac.at/~bernhard/
Artificial Intelligence          ········@ai.univie.ac.at