Another for the gurus ...
[1/1] from: joel::neely::fedex::com at: 1-Nov-2000 12:53
Since Ingo started us down the puzzle path... ;-)
Here's a quaint bit of code, with two questions:
1) What does it do? (This one's just for fun, as you can
obviously evaluate it and see what it does...)
2) Is this "self-modifying", and if so in what sense, as it
is liberally sprinkled with Copy/Deep expressions?
Inspired by SICP, I'm thinking again about "LET" and closures,
and inspired by Ladislav, I'm thinking again about immutable
code blocks. (Now if I could just get rid of that pesky 'N ...!)
REBOL []
dd: [
[
dd/2/2: 0
dd/2/4: 0
dd/2/6: 1
either dd/2/2 = 0 [
dd/2/4
][
do copy/deep dd/2
]
]
[
dd/1/2: 0
dd/1/4: 0
dd/1/6: 1
dd/1/2: dd/1/2 - 1
dd/1/4: dd/1/4 + dd/1/6
dd/1/6: dd/1/4 - dd/1/6
do copy/deep dd/1
]
dd/1/2: n
dd/1/4: 0
dd/1/6: 1
do copy/deep dd/1
]
for i 0 8 1 [ print [n: i do copy/deep dd] ]
-jn-
--
; Joel Neely [joel--neely--fedex--com] 901-263-4460 38017/HKA/9677
REBOL [] foreach [order string] sort/skip reduce [ true "!"
false head reverse "rekcah" none "REBOL " prin "Just " "another "
] 2 [prin string] print ""