#FixMe: It should be explained by references to source code, not some
stupid "examples" :) .
# It seems that 'apply' and 'let' do not call the same 'bind' procedure.

# Second example is not interesting.  'a' is 'eval'uated before 'eval' is
'applly'ed.
# In 3rd example "global​" 'val'ue is returned.

[setq Offset 1  Lst '[Z]]
[setq X 1  Y 2  Z 3]
[de ex1 [X Y Z]
   [! eval '[! list X Y Z] Offset Lst] ]

[de ex2 [X Y Z X Y Z]
   [let [Y 'local]
      [! ex1 11 12 13] ] ]

[de ex3 [X Y Z]
   [! ex2 210 220 230 211 221 231] ]

NIL
: [version]
3.1.9.7
-> (3 1 9 7)
: [setq *Dbg T]
: [ex3 31 32 33]
(ex2 210 220 230 211 221 231)
!
(ex1 11 12 13)
!
(eval '(! list X Y Z) Offset Lst)
! [trail T]
-> ((ex3 31 32 33) X 211 Y 221 Z 231 (ex2 210 220 230 211 221 231) X 31 Y
32 Z 33 X 210 Y 220 Z 230 Y local (ex1 11 12 13) X 11 Y 12 Z 13 ^ (eval '(!
list X Y Z) Offset\
 Lst) *Run NIL @ ex3)
! Y
-> 12
! [up 1 Y]
-> local
! [up 2 Y]
-> 220
! [up 3 Y]
-> 32
! [up 4 Y]
-> 221
! [up 5 Y]
-> 2
! [eval 'Y]
-> 12
! [eval 'Y 1]
-> local
! [eval 'Y 2]
-> 221
! [eval 'Y 3]
-> 2
!
(list X Y Z)
!
-> (210 local 13)
: [bye]

Reply via email to