From: Robert Klemme Date: 2007-09-12T15:39:28+09:00 Subject: Re: Bug in lambda? 2007/9/12, Logan Capaldo : > On 9/11/07, dblack@wobblini.net wrote: > > > > > I think the only hurdle is just realizing that: > > > > {|x| ... } > > > > is an assignment to x. After that, it's no more dangerous or > > error-prone than any other occasion when you have to choose a name for > > a temporary (or not) variable and assign to it. > > > It's not though. It's _almost_ like an assignment to x, except when > it's like passing a parameter. If it really was always just assigning > to x, my example would overflow in both cases, which while not my > personal ideal, would make me happier than the current situation. Actually I believe David is right. It *is* just an assignment to x but you have to keep in mind the scoping rules of blocks. Basically the notation |x| is just a shortcut for an assignment with a parameter when the block is called. But the general scoping rule for local variables in blocks is that they are block local when not defined outside of the block. This is the same regardless whether a var name occurs between bars or on the left side of an assignment. Kind regards robert