Tanaka Akira:

> I don't decided the interface yet.

okay.
 
> Apart from that, this is a interesting example with variable scope.
> Ruby/ProgressBar can be used as follows:
> 
> pbar = nil
> open("http://...",
>   :content_length_proc => lambda {|s|
>     (pbar = ProgressBar.new("test", s)).file_transfer_mode if s
>   },
>   :progress_proc => lambda {|s|
>     pbar.set s if pbar
>   })
> 
> In Ruby2, `pbar = nil' can be dropped.

yes, it seems almost bizarre that pbar is kept "on hand" by both lambdas. this is closure right? wow! this could have big effects on Ruby1 code running with Ruby2.
 
> > Oh, I have aside question: is it possible to use open_uri to test connection speed?
> 
> Since open-uri is intended to be very high level interface, I don't
> think it's suitable to measure connection speed.

oh? that seems contradictory. but that's okay. perhaps i will just bring it up later ;) ...unless, by suitable you mean it would be too difficult to impliment.

-t0

p.s. if you don't mind me asking, what do you think of Structural Reflection?