From: Mathieu Bouchard Date: 2001-02-20T10:50:35+09:00 Subject: [ruby-talk:11142] Re: RCR's On Wed, 14 Feb 2001, Robert Feldt wrote: > class Proc > def *(other) > raise unless arity == other.arity > proc {|*a| self.call(other.call(*a))} > end > end wouldn't that be "raise unless arity == 1" ? > # BTW, this sure might be useful so you can consider this a RCR ;-) > # and why not throw in some syntactic sugar for the "lambda{|x| ...}" > # stuff � la Haskells "\x -> 2*x" while we're at it! I may have preferred {} to always represent a Proc, like in Self and Brain languages. Writing Hash[] instead of {} would be ok to me. However, this would not be a minor change given that {} as a Proc special parameter would also conflict with {} as a normal Proc value: foo {|x| 42} #=> normal ruby: foo(&proc{|x| 42}) foo {|x| 42} #=> this proposal: foo( proc{|x| 42}) however, %p{|x| 42} as a shorthand for proc{|x| 42} would be nice if it wasn't only 2 characters shorter. matju