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

Re: APPLY with 3+ arguments



	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. 

Another use is to write functions like the following:

(defun simplify (new old sequence &rest keyword-args)
  (apply #'remove-duplicates
    (apply #'substitute new old sequence :count 1 keyword-args)
    keyword-args))

If APPLY took only two arguments it would be necessary for this function to
either take explicit keywords itself or splice the :count keyword/value pair
into the argument list for SUBSTITUTE manually.  (BTW: Adding keyword arguments
in this way is well-defined -- see pg. 62 of CLtL.)

				--Stuart A. Malone