From: Eric Mahurin Date: 2005-10-02T04:36:48+09:00 Subject: Re: ideas for an RCR: variable locality --- Trans wrote: > And a way to share vars from the above scope specifically: > > z = lambda [ > share :x > ] I was hoping to not bring in any type of variable declaration syntax (like perl's my/our/local) into play. I was also thinking that this type of block would have no write access to the variables in the surrounding scope (block would need to return data instead). You could give read-only access when the block accesses one of its variables not yet assigned to (get the value from the containing scope): x = 1+2 z = lambda {{ # becomes equivalent to y = (x=3) when compiled y = x }} Hopefully this could be done in such a way so that once that block is created it doesn't need access to its containing scope anymore and you don't have to worry about the block preventing GCing stuff in that scope (as you do with normal blocks). Although you wouldn't be able to get the Binding of this type of block, you would still want to have a way to get the file, line, (and column?) of where the block was created. > Since hash and block share literal deliminators, it only > seems fair > that array do the same ;-) But [] is also an operator and {} is not. To use [] for a different type of block, you'd have to differentiate between it and the [] operator based on spacing - which I think is bad. __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com