[REBOL] Re: RFC: new feature for local word handling
From: ammon:addept:ws at: 31-Dec-2002 5:12
Hi,
Have you tried just using 'context? There is no rule that states that
you have to pass the value from 'context to a word. ;-)
Example:
>> myblock: [
[ myvar: 3
[ print myvar * 3
[ ]
== [
myvar: 3
print myvar * 3
]
>> context myblock
9
>> myvar
** Script Error: myvar has no value
** Where: connect-to-link
** Near: myvar
myblock is DOne without poluting the global namespace. Albeit there are a
few drawbacks like you would probably have to declare any words you want in
the global namespace before the execution of the 'context, but all in all it
allows you to have something like 'use, but without first declaring
variables. You might consider it a lightweight sandbox. ;-)
Enjoy!!
Ammon Johnson
CIO of Addept ---------- (www.addept.ws)
435.616.2322 ---------- (ammon AT addept.ws)