Last active
September 5, 2017 15:24
-
-
Save honix/2c72e78bdc4b2d6511283d0436688744 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red [] | |
let: func [ | |
binds | |
block | |
/local | |
ctx | |
][ | |
ctx: context append/only append binds copy [result: do] block | |
select ctx 'result | |
] | |
g: 1 | |
b: 42 | |
let [ | |
a: 100 | |
b: 200 | |
c: b - a | |
][ | |
a + b + c + g | |
] ;-- will return 401 | |
b ;-- will return 42 from global context | |
let [a: 1 b: 2 c: 3] [let [g: 15] [a + b + c + g]] ;-- will return 21 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In Rebol 3 (Ren-C):
CONTEXT should always return an OBJECT! :) Hence why WRAP was added to Rebol 3 (and Ren/C branch went further and disallowed RETURN).