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

[REBOL] Re: local vars in functions

From: carl:cybercraft at: 24-Apr-2002 23:20

On 24-Apr-02, Rishi Oswal wrote:
> Using the "::" shortcut in a global context would be > the same as using a ":". > The disadvantage I see is that it adds another thing > to the language.. But consider that now we could stop > using the /local keyword, reduce bugs, and use it > consistently everywhere, overall it can simplify > things. > Anybody have other reasons as to why it was not done > this way??
I like the idea and the syntax, but what happens with the likes of this... a: 10 a:: 20 a: 30 Does that produce an 'a in both the global and local context? And if so, does the third expression above change the local or global value, or both? Afterall, we can do this in REBOL...
>> a: 10 b: 20
== 20
>> fun: has [a][a: 50 print a print b] >> fun print a
50 20 10 Though I doubt it's good practice. (: -- Carl Read