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

Re: do-nothing macro generates nil nevertheless



In article <3irfm9$1ti@news.internex.net> yost@rclsgi.eng.ohio-state.edu (Dave Yost) writes:
>My point is that some functionality is not provided:
>namely, the ability of a macro to expand into _nothing_.

I think the original Common Lisp designers considered the idea of allowing
macros to return multiple values, which would be spliced into the
containing form.  Had this been included, a macro could expand into nothing
by returning (values).

However, this is would be a very confusing feature.  It works out nicely in
a sequencing form like PROGN, but it doesn't fit in well with function
calls.  Consider (print (foo)).  This looks perfectly valid, but if (foo)
were to expand into nothing then it would be (print), which is invalid.  Or
in (if (foo) (bar) (baz)), if (foo) expands into nothing the then-form
would become the test-form and the else-form would become the then-form!

-- 
Barry Margolin
BBN Internet Services Corp.
barmar@near.net