[#1711] Re: open-uri patch, added progress_proc hook — "T. Onoma" <transami@...>

Tanaka Akira:

22 messages 2003/11/19
[#1737] Re: open-uri patch, added progress_proc hook — Mathieu Bouchard <matju@...> 2003/11/23

[#1739] Re: open-uri patch, added progress_proc hook — Mathieu Bouchard <matju@...> 2003/11/23

[#1740] Re: open-uri patch, added progress_proc hook — "T. Onoma" <transami@...> 2003/11/23

On Sunday 23 November 2003 08:26 pm, Mathieu Bouchard wrote:

[#1741] Re: open-uri patch, added progress_proc hook — Mathieu Bouchard <matju@...> 2003/11/23

[#1718] Re: open-uri patch, added progress_proc hook — Elliott Hughes <ehughes@...>

22 messages 2003/11/21
[#1722] Re: open-uri patch, added progress_proc hook — Tanaka Akira <akr@...17n.org> 2003/11/22

In article <AD4480A509455343AEFACCC231BA850F17C434@ukexchange>,

[#1724] Re: open-uri patch, added progress_proc hook — "T. Onoma" <transami@...> 2003/11/22

On Saturday 22 November 2003 04:34 pm, Tanaka Akira wrote:

[#1726] Re: open-uri patch, added progress_proc hook — Tanaka Akira <akr@...17n.org> 2003/11/23

In article <200311221024.05642.transami@runbox.com>,

[#1731] Re: open-uri patch, added progress_proc hook — "T. Onoma" <transami@...> 2003/11/23

On Sunday 23 November 2003 02:24 am, Tanaka Akira wrote:

[#1732] Re: open-uri patch, added progress_proc hook — Tanaka Akira <akr@...17n.org> 2003/11/23

In article <200311230325.21687.transami@runbox.com>,

[#1733] Re: open-uri patch, added progress_proc hook — "T. Onoma" <transami@...> 2003/11/23

On Sunday 23 November 2003 03:10 pm, Tanaka Akira wrote:

[#1750] Re: open-uri patch, added progress_proc hook — Tanaka Akira <akr@...17n.org> 2003/11/24

In article <200311230648.41003.transami@runbox.com>,

[#1759] Re: open-uri patch, added progress_proc hook — Sean E Russell <ser@...> 2003/11/24

On Monday 24 November 2003 03:19, Tanaka Akira wrote:

[#1762] Re: open-uri patch, added progress_proc hook — "Nathaniel Talbott" <nathaniel@...> 2003/11/24

Sean E Russell [mailto:ser@germane-software.com] wrote:

[#1753] gc_sweep under 1.8 ... not syck.so — Richard Kilmer <rich@...>

We still encountered a gc_sweep in our use of Ruby 1.8 on Linux (v8).

16 messages 2003/11/24
[#1754] Re: gc_sweep under 1.8 ... not syck.so — ts <decoux@...> 2003/11/24

>>>>> "R" == Richard Kilmer <rich@infoether.com> writes:

[#1757] Re: gc_sweep under 1.8 ... not syck.so — Richard Kilmer <rich@...> 2003/11/24

Yes, there are several (Ruby) threads working during this gc_sweep.

[#1758] Re: gc_sweep under 1.8 ... not syck.so — ts <decoux@...> 2003/11/24

>>>>> "R" == Richard Kilmer <rich@infoether.com> writes:

[#1763] Re: gc_sweep under 1.8 ... not syck.so — Richard Kilmer <rich@...> 2003/11/24

of course this effects 300 machines ;-)

[#1755] Re: Controlled block variables — Jamis Buck <jgb3@...>

On Mon, 2003-11-24 at 02:04, T. Onoma wrote:

26 messages 2003/11/24
[#1756] Re: Controlled block variables — "T. Onoma" <transami@...> 2003/11/24

On Monday 24 November 2003 05:22 pm, Jamis Buck wrote:

[#1760] Re: Controlled block variables — Sean E Russell <ser@...> 2003/11/24

On Monday 24 November 2003 11:51, T. Onoma wrote:

[#1761] Re: Controlled block variables — "T. Onoma" <transami@...> 2003/11/24

On Monday 24 November 2003 06:40 pm, Sean E Russell wrote:

Re: block locals & Ruby2 [was Re: open-uri patch, added progress_proc hook]

From: Mauricio Fern疣dez <batsman.geo@...>
Date: 2003-11-24 19:54:55 UTC
List: ruby-core #1764
On Mon, Nov 24, 2003 at 06:34:49AM +0900, T. Onoma wrote:
> On Sunday 23 November 2003 10:04 pm, Mauricio Fern疣dez wrote:
> > On Mon, Nov 24, 2003 at 05:32:09AM +0900, Mathieu Bouchard wrote:
> > > I think the actual problem would be more with code that does things like
> > > this:
> > >
> > > def foo(n)
> > >   (0...n).map {
> > >     proc {a=0; proc{a+=1;a}}[]
> > >   }
> > > end
> >
> > This would work with the new rules (and the current ones), I believe:
> >
> > def foo(n)
> >   (0...n).map { proc {|a| proc{ a += 1; a } }[0] }
> > end
> >
> actually using
> 
>   foo(3).each { |q| p q.call } 
> 
> they both produce
> 
>   1
>   1
>   1

This is the behavior matju wanted (n independent counters). It works in
1.x because the block argument is local unless it was already in use in
the outer scope, and will in 2.0 because block args will *always* be
local.

> but in both, if you add a=0:
> 
>   def foo(n)
>     a = 0
>     (0...n).map { proc {|a| proc{ a += 1; a } }[0] }
>   end
> 
> then
> 
>   1
>   2
>   3

a exists in the method scope, so it's not block local in this case (for
1.x)

> So you tell me how it changes in new system, cause I don't know. i'm
> guessing the first won't be 1 1 1 anymore. but who am i to say? i find the 
> examples confusing enough in themselves :).

In 2.0, you'd get 1 1 1 in the second case, and a warning ("shadowing is evil" or such :-),
if I understood correctly matz's latest statements on the matter.

Note that this could also be written as 

def foo(n); (0..n).map{ local{|a| a = 0; proc{ a+= 1; a} } }

with
 def local
   yield
 end

I'd really like to try :=, 
def foo(n); (0..n).map{ a:= 0; proc{ a+=1; a } }

but it seems that matz has definitely abandoned the idea :-(

-- 
 _           _                             
| |__   __ _| |_ ___ _ __ ___   __ _ _ __  
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ 
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
	Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

<miguel> any new sendmail hole I have to fix before going on vacations?
	-- Seen on #Linux

In This Thread