[#300] Ruby 1.3.3-990507 — matz <matz@...>
Ruby 1.3.3-990507 is out, check out:
1 message
1999/05/07
[#314] Arity features for Proc object? — matz@... (Yukihiro Matsumoto)
A mail from <yeboah@tu-harburg.de> is somehow rejected by the list
12 messages
1999/05/17
[#315] Re: Arity features for Proc object?
— matz@... (Yukihiro Matsumoto)
1999/05/17
[#316] Re: Arity features for Proc object?
— gotoken@... (GOTO Kentaro)
1999/05/17
In message "[ruby-talk:00315] Re: Arity features for Proc object?"
[#318] Re: Arity features for Proc object?
— matz@... (Yukihiro Matsumoto)
1999/05/17
Hi.
[#319] Re: Arity features for Proc object?
— gotoken@... (GOTO Kentaro)
1999/05/17
In message "[ruby-talk:00318] Re: Arity features for Proc object?"
[#320] Re: Arity features for Proc object?
— matz@... (Yukihiro Matsumoto)
1999/05/17
Hi.
[#323] binding — Pros Yeboah <yeboah@...>
Hi
5 messages
1999/05/18
[#357] thinking aloud — "Bryce Dooley" <thecrow@...>
First off, I think Ruby is a very nice scripting language.
7 messages
1999/05/29
[ruby-talk:00352] Re: local variables
From:
matz@... (Yukihiro Matsumoto)
Date:
1999-05-27 08:04:21 UTC
List:
ruby-talk #352
In message "[ruby-talk:00351] local variables"
on 99/05/27, Pros Yeboah <yeboah@tu-harburg.de> writes:
|Can someone please explain it ,why I get this:
|ruby -e'i=3;def foo;p defined?(i);end;foo' #==>nil
|ruby -e'i=3;1.times{p defined?(i)} #==>"local-variable"
Because a function definition introduces new scope, so you have a
clean local variable space in foo. That's the reason you receive nil
from defined?(i) in foo. Scopes by function do not nest, i.e. you
cannot access local variables in the outer scope.
On the other hand, even though blocks introduces scopes, they nest.
You can access local variables in the outer scope within the blocks.
matz.