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

[REBOL] Block Creation Re:

From: brett:codeconscious at: 19-Oct-2000 1:00

Hi Carl, You've tripped over a usage which is normally comes up when people define functions. In the second example, each time through the loop a new block value is created and block2 is set to this new value. So your insert modifies a different block each time. In the first example a block value is created once at some point when the interpreter goes to execute your loop, then each time through the loop the word block1 is set to this same value. Hence you are modifying the same block (in memory). Note: In my explanation I've made reference to memory and the interpreter. I don't know if this is how it works for sure, but it should give you the idea. For more messages on the same theme see: http://www.codeconscious.com/rebol/tips-and-techniques.html#Wordsarenotvaria bles1 Brett.