From: Hugh Sasse Staff Elec Eng Date: 2004-03-04T20:07:55+09:00 Subject: Re: concerns about Proc,lambda,block On Thu, 4 Mar 2004, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: concerns about Proc,lambda,block" > on 04/03/03, Mauricio Fern�ndez writes: > > |do you want to keep Proc and lambda as separate things (like Class & > |Module) or would you consider merging them and reaching a compromise on > |their semantics? > > My current stand point is that conceptually lambda returns a Proc > wrapped by argument checker and local jump handler, thus a Proc from > lambda is still a Proc. If you really wish to distinguish those two > (wrapped proc and unwrapped proc), you still have chance to persuade > me. I'm not sure what the right thing to do would be: sometimes simplicity is acheived by similarity, other times by difference. However, I think some kind of reflection would be useful, whatever you decide. Maybe a wrapped?() method might be useful, so at least when debugging we can ask the code "Are you a wrapped proc or not?" Just thinking out loud: maybe wrapped() and unwrapped() could return a wrapped and an unwrapped version of the sender proc respectively, allowing coversion between the two? If the proc already is (un)wrapped, then (un)wrapped() is just dup(), perhaps? I think this would still leave blocks as "non-objects" because they cannot occur except after a method, so there'd be no danger of trying to wrap or unwrap a block. > > matz. > Hugh