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

[REBOL] USE and SET

From: henrik::webz::dk at: 27-Jul-2006 5:37

Why does this work like so: >> d: [a b c] ; dynamic block of words == [a b c] >> a ** Script Error: a has no value ** Near: a OK, so far. >> use d [set d [1 2 3]] == [1 2 3] >> a == 1 ; a is global Not good. I want a, b and c to be local to that USE block. Unsetting a, b and c again: >> unset d >> a ** Script Error: a has no value ** Near: a Using copy/deep is no good: >> use d [set copy/deep d [1 2 3]] == [1 2 3] >> a == 1 >> unset d Still no good: >> use copy/deep d [set copy/deep d [1 2 3]] == [1 2 3] >> a == 1 However if I refer to the block directly: >> use d [set [a b c] [1 2 3]] >> a ** Script Error: a has no value ** Near: a It works as intended, but I want the block of words being set to be dynamic. How? -- Regards, Henrik Mikael Kristensen