[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

APPLY with 3+ arguments



    Date: 22 Jun 87 07:19 EDT (Monday)
    From: Richard Fritzson <fritzson@bigburd.PRC.Unisys.COM>

    Can anyone provide a motivation for the CLtL definition of APPLY when
    more than one arglist is provided? I understand what it does perfectly
    well, but I don't understand when I am going to have a use for this.

There are two common uses I have seen.  One is to have a function take
an &REST arg which is the arguments for some other function, yet the
middle-man wants to supply additional keywords or override them, such as
	(defun make-raster-bit-array (width height &rest other-make-array-args)
	  (apply #'make-array (list height width) :element-type 'bit
		 other-make-array-args))

The other common case is similar, but is used to supply required
and optional arguments to a function which also takes an &REST arg, for
example, 
	(defun trace-format (format-string &rest format-args)
	  (apply #'format *trace-output* format-string format-args))