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

[REBOL] IDIOMS: setting multiple words

From: greggirwin::mindspring::com at: 9-Oct-2003 13:08

Hi All, I had a thought as I was tinkering with different REBOL constructs, to see which one I liked best, for a particular bit of functionality. Sometimes, as you know, a very REBOLish idiom can make all the difference in the world. Here's the idea; you pose a scenario and people can post different approaches they might use to handle it. It's not a contest for the smallest solution, but rather to show different *ways* things can be done. ;---------------------------------------------------------------- Scenario: You have a number of words that you want initialized to "copy []" or some other value. Do you do it like this? foo: copy [] bar: copy [] baz: copy [] Or like this? foreach word [foo bar baz][set word copy []] Or something else. Do you use a different approach for more or less words? Do you do things differently if you're setting words in a object? Do you do something different based on the initial value? Is there anything else you take into consideration when you do this kind of thing? Thanks for playing! --Gregg