[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
&whole
I usually try to stay out of these but...
it seems that &whole is pretty much of a hack, but if you are gonna
leave it in, there is no point in hacking it up further.
&whole should be treated like &rest: does it make sense to say
(lambda (a b &rest c d e) --)
where c is bound to the tail and d and e are respectively the car and
cadr of c with arg count checking turned on?
one way around the dilemma of argument checking is to include a
macro/special form:
(destructure-args form (arg1 arg2 arg3) ...)
which 'destructured' form, performed the same arg checking that macro
expansion did, and then executed ....
Where you would have the user write
(defmacro foo (&whole whoarg a b ) ---)
which is pretty confusing, he would write
(defmacro foo (&whole whoarg)
(destructure-arg whoarg (a b) --))
makes a little more sense, and doesn't rely on obscure rules about
arglists etc.
Sorry for intruding...
Larry