From: matz@... (Yukihiro Matsumoto) Date: 2002-08-06T15:37:14+09:00 Subject: Re: block , yield and proc? Hi, In message "block , yield and proc?" on 02/08/06, "Shashank Date" writes: |I am experimenting with code using blocks, yield and proc in Ruby (1.7.2 |mswin32) and discovered three different ways of expressing the same idea: First, you have to learn several tips: (a) block parameter |v| means takes everything in a single variable, which is better described as |*v|. (b) "call" requires exact number of required argument, whereas "yield" fills nil for fewer arguments and ignores too much arguments. |Q1: Why does the following code : This is caused by (b). |Q2: What exactly is the semantic difference between using a bloc parameter |(with &) and a yield? This is answered almost by (b). In addition, a block argument (&block) creates one more object. |Q3: And what about using Proc? No difference, except for appearance. matz.