[pro] The Best Examples of "Code is Data"

Luís Oliveira luismbo at gmail.com
Tue Sep 7 22:28:13 UTC 2010


On Tue, Sep 7, 2010 at 11:15 PM, Daniel Weinreb <dlw at itasoftware.com> wrote:
> What happens if you do
>
> (defun foo (x)
>   (plus x 3))

Since (constantp 'x) yields nil, the compiler macro will bail out. I
suppose a smarter version could perform some optimizations when only
one of the arguments is constant.

On a related note, I just came across this SBCL effort
<https://bugs.launchpad.net/sbcl/+bug/632368> which has the potential
to make compiler macros significantly more powerful by handing forms
over only after they've been through the compiler's inlining and
constant propagation phases!

-- 
Luís Oliveira
http://r42.eu/~luis/




More information about the pro mailing list