From: Michael Lucas-Smith Date: 2002-01-01T09:23:38+09:00 Subject: [ruby-talk:29917] Re: Proc.class vs yield Joel VanderWerf wrote: > Michael Lucas-Smith wrote: > > >>Surely you'd need "some_method {|x| x+1}, {|y| y-1}" a comma in there? >> > > Well, this is all fantasy land anyway, but I was generalizing > > somemethod (arg1, arg2) { ... } > > which has no comma between the arglist and the block. > > A block is not an object, just a syntactical construct, so it cannot be > the value of a variable, argument, parameter, etc. So, it seems to me, > there's no reason for a comma in the syntax. > > What is the process in which fantasy becomes reality? Because this whole yield thing isn't required, but it's there. Because people like it. But then there is this 'only one' restriction which, please excuse the expression, seems totally brain dead to me. It's being imposed on coders needlessly IMHO. Many languages over the years have had some pretty strange limitations. Typing for example (*g*), but this one. "In all cases you can pass as many arguments as defined by the method. Except for the case of blocks, where you have to pass procs instead." .. doesn't really seem very nice to me. I really do vote for having the compiler automatically handle the proc conversion for you. Michael