[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
(byte-compile '(append '(1 2) '(3 4)))
From: |
Felician Nemeth |
Subject: |
(byte-compile '(append '(1 2) '(3 4))) |
Date: |
Sat, 16 Mar 2024 13:16:36 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
(disassemble (byte-compile '(append '(1 2) '(3 4))))
resuts in
byte code:
args: nil
0 constant append
1 constant (1 2)
2 constant (3 4)
3 call 2
4 return
Instead I expected it to be something like
byte code:
args: nil
0 constant 1
1 constant 2
2 constant 3
3 constant 4
4 list4
5 return
I've never looked at byte-code optimization before, and I'm guessing
this is not a huge improvement, but I still wonder when all the
arguments of side-effect-free function are constants would it make sense
to calculate the result at compile time.
Thanks.
- (byte-compile '(append '(1 2) '(3 4))),
Felician Nemeth <=