< :the previous in number
^ :the list in numerical order
> :the next in number
P :the previous (in thread)
N :the next (in thread)
|<:the top of this thread
>|:the next thread
^ :the parent (reply-to)
_:the child (an article replying to this)
>:the elder article having the same parent
<:the youger article having the same parent
---:split window and show thread lists
| :split window (vertically) and show thread lists
~ :close the thread frame
.:the index
..:the index of indices
On Mon, Oct 07, 2002 at 12:01:41AM +0900, ts wrote:
> >>>>> "M" == MikkelFJ <mikkelfj-anti-spam / bigfoot.com> writes:
>
> M> := assigns to local block scope,
>
> := assign to a variable which is always local to the block, even if a
> variable with the same name exist in an outer block. For example
>
> b = 12
> 1.times { b := 2 }
>
> `b := 2' will create a new block variable which shadow the previous
> variable `b'
matz said previously that in
(0...10).each { |x| ... }
the values would be assigned to x with ':=', that is,
x = ...
inside the block would use the local. Put otherwise, this is the same as
the "make them all local" solution w.r.t. block parameters!
> M> = assigns to outside the local block scope.
>
> = has the same meaning than actually, if a previous variable exist ruby
> use this variable otherwise it create a variable local to the block
>
Isn't this much stranger than what we have now?
i = 0
x = 'some value'
(0...10).each do |i|
x := 'surprise!' if i == 2
x = i # uses local after the := is run
end
x => 1
Having 'x = ...' meaning completely different things depending on the
"execution context" makes me feel unsecure.
>
> M> What happens with nested scopes.
>
> same
>
--
Mauricio Julio Fernandez Pradier