[#1579] arity bug? — "Christoph" <chr_news@...>
Hi,
5 messages
2003/10/05
[#1588] FreeBSD problem with processes — Laurent Sansonetti <pinux@...>
Hi all,
1 message
2003/10/07
[#1591] Re: Yielding to a block from a proc? — george.marrows@...
> > Is this right? Is this pathological? Is it a bug? Is there
6 messages
2003/10/08
[#1596] PATCH: Revive NextStep, OpenStep, Rhapsody ports — Eric Sunshine <sunshine@...>
Hello,
7 messages
2003/10/09
[#1597] Re: PATCH: Revive NextStep, OpenStep, Rhapsody ports
— matz@... (Yukihiro Matsumoto)
2003/10/09
Hi,
[#1600] CVS access — Sean Russell <ser@...>
Hiya,
8 messages
2003/10/09
[#1611] set_trace_func/Array#fetch error — "Nathaniel Talbott" <nathaniel@...>
I've reduced the error I reported in ruby-talk:84013 to the following code:
17 messages
2003/10/11
[#1612] Re: set_trace_func/Array#fetch error
— ts <decoux@...>
2003/10/11
>>>>> "N" == Nathaniel Talbott <nathaniel@talbott.ws> writes:
[#1616] Re: set_trace_func/Array#fetch error
— "Nathaniel Talbott" <nathaniel@...>
2003/10/11
ts [mailto:decoux@moulon.inra.fr] wrote:
[#1617] Re: set_trace_func/Array#fetch error
— ts <decoux@...>
2003/10/11
>>>>> "N" == Nathaniel Talbott <nathaniel@talbott.ws> writes:
[#1618] Re: set_trace_func/Array#fetch error
— "Nathaniel Talbott" <nathaniel@...>
2003/10/11
ts [mailto:decoux@moulon.inra.fr] wrote:
[#1634] stringy range bug — "Christoph" <chr_news@...>
Hi,
6 messages
2003/10/15
[#1640] SystemStackError in embedding — Sentinel <sentinel27@...>
Hi, I am just now trying to embed ruby into my apprication
8 messages
2003/10/18
Re: Yielding to a block from a proc?
From:
Sean Russell <ser@...>
Date:
2003-10-08 14:08:25 UTC
List:
ruby-core #1592
On Wednesday 08 October 2003 08:49, george.marrows@ps.ge.com wrote:
...
> def test
> proc { yield 123 } # <-- captures block passed to test
> end
>
> p = test { |a| puts "Got #{a}" }
>
> p.call()
>
> Though this is fairly weird (does anyone use it?), it's entirely in keeping
> with the fact that blocks have access to the blocks that were passed into
> their scope:
How does that matter?
def test x
proc { puts x } # x scoped up
end
def test x
proc {
x = "foo" # x has been redefined
puts x
}
end
I've been following this thread with very little interest; I haven't seen a
compelling use case for passing blocks to procs, but I don't see why scoping
issues would cause problems -- any more than Proc scoping rules already do,
that is.
--
--- SER