From: Mike Date: 2001-05-30T00:04:13+09:00 Subject: [ruby-talk:15930] Re: Block arguments vs method arguments On Tue, 29 May 2001 23:09:56 +0900 ts wrote: > >>>>> "M" == Mike writes: > > M> Why aren't they arguments? or why aren't methods arguments a > M> multi-assignement? > > a block is defined independantly of |x, y, z| not a method. I don't understand. Blocks have arity, their arguments are not independant. > > M> Then I rejoin the still open (?) thread about local block vars. > M> I like the notation that was proposed to have a, b and c > M> local to the block. It would be nice it if these args would be defined > ^^^^^^^^^^^^^^^^ > M> like method arguments, and I would love it if variables created in the > ^^^^^^^^^^^^^^^^^^^^^ > What do you want to say with this ? I'd like to be able to define block arguments like method arguments; to have a kind of block that is more method like. > > M> block would be created in the caller's binding. > > This mean that will be equivalent to (x, y), strange why do you use > a different delimitor ? > I would like to use the same delimitor, but it may be hard to differenciate with expression brackets. > Now I can write |$x, $y| the next step will be to have 'def toto($x, $y)' ? > I like def toto(@x, @y), but it has already been discussed and rejected. I dislike global variables... > There are too many difference between variables in || and the definition > of a def. This is not what I excepted. Are there as many differences between blocks and methods? I see blocks as code with the creator's binding and methods as code with the receiver's binding. Blocks and methods are very similar for me. Aren't they? Mike. midulo.