Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[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
>> 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 ---------- ( 435.616.2322 ---------- (ammon AT