[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `eval'ing form in the current lexical environment
From: |
Stefan Monnier |
Subject: |
Re: `eval'ing form in the current lexical environment |
Date: |
Sun, 07 Jul 2024 22:49:41 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
> All macros are expanded and processed, thus `(,head ,@args) above is
> /necessarily/ a function call... that is, unless it is later redefined
> as a macro.
I think this is the part I don't understand: why do you worry about
`head` being a function (or undefined) during macro-expansion but
a macro at run-time?
If the code is compiled, such a change leads to an error and we blame
the change, not the compiler.
E.g. M-: (disassemble '(lambda () (foobar 5))) RET
turns into the byte-code:
byte code:
args: nil
0 constant foobar
1 constant 5
2 call 1
3 return
and this `call` just signals an error if `foobar` is not a function at
run-time.
So, I think what I'm saying is that you should probably not try to
handle this case at all.
Stefan