Let's start with an example
After compiling, it looks like this:
Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F
00000000 0D 0A 20 46 41 53 34 2D 46 49 4C 45 20 3B 20 44 FAS4-FILE ; D
00000010 6F 20 6E 6F 74 20 63 68 61 6E 67 65 20 69 74 21 o not change it!
00000020 0D 0A 31 0D 0A 31 20 24 20 24 0D 0A 31 32 33 20 1 1 $ $ 123
00000030 36 20 24 14 01 01 01 00 32 00 32 22 2A 39 01 00 6 $ 2 2"*9
00000040 55 01 00 02 00 64 64 5B 54 54 00 45 56 41 4C 00 U dd[TT EVAL
00000050 00 5B 4C 41 4D 42 44 41 00 00 5B 4B 00 00 39 01 [LAMBDA [K 9
00000060 00 5B 41 4C 45 52 54 00 00 5B 4B 00 00 39 02 00 [ALERT [K 9
00000070 39 03 00 01 01 43 00 00 06 00 0A 01 5C 00 00 43 9 C \ C
00000080 00 00 01 00 0A 01 43 06 00 00 00 1C 14 01 00 00 C
00000090 00 09 05 00 0A 09 04 00 34 00 07 35 01 03 00 03 4 5
000000A0 0B 06 02 00 0A 09 01 00 35 01 02 00 03 16 15 00 5
000000B0 B6 81 1A 52 B3 0A 3B 66 61 73 34 20 63 72 75 6E ? R?;fas4 crun
000000C0 63 68 0A 3B 24 3B 41 32 2F 31 38 2F 32 30 ch ;$;A2/18/20
(setq tt (eval(function(lambda (k) (alert k) ))))
(tt "dd")
These two sentences are compiled as follows:
Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F
00000000 0D 0A 20 46 41 53 34 2D 46 49 4C 45 20 3B 20 44 FAS4-FILE ; D
00000010 6F 20 6E 6F 74 20 63 68 61 6E 67 65 20 69 74 21 o not change it!
00000020 0D 0A 32 36 0D 0A 33 20 24
14 01 01 01 00 09 02 26 3 $
00000030 00 5C 00 00 18 03 00 03 02 00 35 01 01 00 03 19 \ 5
00000040 01 00 16 24 0D 0A 31 33 39 20 37 20 24 14 01 01 $ 139 7 $
00000050 01 00 32 00 32 2A 2A 39 01 00 55 01 00 02 00 64 2 2**9 U d
00000060 64 5B 54 54 00 45 56 41 4C 00 00 56 6B 77 6F 74 d[TT EVAL Vkwot
00000070 65 00 00 01 01 43 00 00 06 00 0A 32 00 32 1A 2A e C 2 2 *
00000080 39 01 00 5B 41 4C 45 52 54 00 4B 00 00 5C 00 00 9 [ALERT K \
00000090 43 00 00 03 00 0A 5C 00 00 32 00 5B 2D 6C 61 6D C \ 2 [-lam
000000A0 62 64 61 2D 00 00 3A 01 43 06 00 01 00 1C 14 01 bda- : C
000000B0 00 00 00 09 05 00 0A 57 00 00 00 00 09 06 00 51 W Q
000000C0 01 04 00 01 00 35 01 03 00 03 0B 06 02 00 0A 09 5
000000D0 01 00 35 01 02 00 03 16 18 00 A9 8A FC F9 EA 3D 5 ?
000000E0 9D EE 0A 3B 66 61 73 34 20 63 72 75 6E 63 68 0A ?;fas4 crunch
000000F0 3B 24 3B 41 32 2F 31 38 2F 32 30 ;$;A2/18/20
We can see the following points:
1. No Function is defined when quote is used
Function function is used to define a Function, - lambda -, the content of the Function is the red part
2. When quoting, (alert K) is interpreted as a table.
3. If Function function is used, alert and K are two independent strings.
Conclusion: when quote is used, lambda is not compiled into a Function, which is interpreted and runs slowly. When Function function is used, lambda is compiled into a function, which can be optimized with high speed.
The so-called optimization is that you can quickly and directly access the function entry address, and do not need to find the address corresponding to the function name before calling.
Some decompiler tools do not properly handle function, so that programs that use this function cannot be decompiled.