From: zuzu Date: 2004-07-09T21:30:24+09:00 Subject: Re: I love Ruby On Fri, 9 Jul 2004 21:15:52 +0900, Kaspar Schiess wrote: > -----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. *lightbulb* word. ..."that's not intuitive!" ;-) i would think that if you want to pass 'puts' a block, you should have to more strongly define: puts(str.gsub) do ... end lots of words with spaces weirds me out, like applescript. > 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 ;) ? certainly. especially if you can finish 'science & sanity' by korzybski. dretske i'm so-so on, but supposidly 'flow of information' is the leading treatise on applying information theory to language... i think his research is solid, but so far disagree with his conclusion that knowledge is "all or nothing"; obviously he hasn't learned null-A from korzybski. > 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----- > >