
9 Sep
2010
9 Sep
'10
2:42 p.m.
Luís Oliveira wrote:
On Tue, Sep 7, 2010 at 11:15 PM, Daniel Weinreb <dlw@itasoftware.com> wrote:
What happens if you do
(defun foo (x) (plus x 3))
Have you tried it? CCL gets very unhappy!
Since (constantp 'x) yields nil, the compiler macro will bail out. Yeah, you'd think.
Maybe I made a mistake.
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!