From: Bruno Haible
Subject: Re: argument passing: defaults
Date: 
Message-ID: <606ml0$ore$1@nz12.rz.uni-karlsruhe.de>
Sam Steingold <···········@cctrading.com> wrote:
> (defun xx (&optional a) (format t "xx: a: ~a~%" a) (zz a))
>
> But I want zz to use the default argument! I did not give xx any arg,
> and I don't want zz to get any arg either.

You can have this, but it's not beautiful:

(defun xx (&rest args)
  (apply (lambda (&optional a)
           (format t "xx: a: ~a~%" a)
           (apply #'zz args)
         )
         args
) )

An alternative would be to introduce a special value denoting the default
value, say :default or :unspecific or so:

(defun zz (&optional (a ':default))
  (when (eq a ':default) (setq a t))
  ...
)


                       Bruno