[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
understanding backquote
From: |
Olaf Rogalsky |
Subject: |
understanding backquote |
Date: |
Tue, 02 Jun 2015 21:17:37 +0200 |
Hi,
I have problems in understanding the semantics of backquote. Consider
the following function:
(defun test () `,(* (+ 1 2) (+ 3 4)))
Now let's have a look at the defintion of the symbol:
(symbol-function 'test)
=> (lambda nil (* (+ 1 2) (+ 3 4)))
Huhh??? I was thinking, that the above definition is equivalent to the
following:
(defun test () 21)
Ok, this was unexpected, but perhaps the compiler does it "right":
(disassemble (byte-compile 'test))
=> byte code:
args: nil
0 constant 21
1 return
Yes, it does. It is only, that I suspect, that this has nothing to do
with backquotes, but rather with constant folding optimization.
Can anybody explain this to me?
Thanks,
Olaf
Message not available
Message not available