From: SASADA Koichi Date: 2011-06-10T04:22:16+09:00 Subject: [ruby-core:36899] Re: [Ruby 1.9-Feature#4326][Open] Fiber should respond to call() and [] Hi, Sorry for late response. (2011/01/26 16:08), Aaron Patterson wrote: > Feature #4326: Fiber should respond to call() and [] > http://redmine.ruby-lang.org/issues/show/4326 > > Author: Aaron Patterson > Status: Open, Priority: Normal > Assigned to: Koichi Sasada > > Fibers are considered to be coroutines. Knuth says "Subroutines are special cases of ... coroutines". This makes sense to me. > > Method, Proc, and lambda respond to `call` and `[]`. If Fiber also responded to `call` and `[]`, we could use coroutines in places where we use lambdas, procs, and methods. > > I've attached a patch that implements the two methods. I don't understand all of this thread. However, as I said to aaron at IRC, I want to reject this proposal. Reasons: (1) Proc is restartable. It can be called infinite times. In general, Fiber is not for such usage. (2) If we permit Fiber#call, maybe other guys say "should support Fiber#[]". However, as you mention, Fiber#[] is ambiguous with Fiber local storage. -- // SASADA Koichi at atdot dot net