From: Kaspar Schiess Date: 2004-07-09T21:15:52+09:00 Subject: Re: I love Ruby -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 zuzu wrote: |> why the difference in scope? |> why does 'do...end' pass into foo instead of bar? Actually the difference is one of 'operator precedence' and not one of scope, as far as {} can be called an operator. {} just binds very thight to the call to bar, whereas do end binds loosely to the call of foo. This means that ~ puts str.gsub { ... } will do what you expected but ~ puts str.gsub do ... end will call puts with a block. Hence the single line/multiline difference. Thank you for your OT (not to me) pointers, I will put them on the list of things to read ! Perhaps you will be interested in my opinion afterwards ;) ? yours, kaspar semantics & semiotics code manufacture www.tua.ch/ruby -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFA7o2oFifl4CA0ImQRAsDzAKCzLCTMaE/f9lvJ3dvWXoSjeDltxgCfewzT dLMLTUzKpxUlwBhIsMvTREQ= =mY7c -----END PGP SIGNATURE-----