From: Christian Neukirchen Date: 2005-03-21T21:49:00+09:00 Subject: Re: strip and its evil brother strip! Mathieu Bouchard writes: > On Sun, 20 Mar 2005, Daniel Amelang wrote: > > Smalltalk also has an alternate mechanism at the syntax level, for making > several methodcalls to a receiver written only once. This makes returning > self sound even stupider to me in that context. I wish Ruby had a similar > feature so that methods never have to return systematically self and so > whenever such a thread appears we could point people to that feature. +1 > Example (with some extra spaces inserted, and supposing there are methods > named like that in Smalltalk) > > Smalltalk: x chop strip. > Ruby: x.chop! .strip! > > Smalltalk: x chop. x strip. > Ruby: x.chop!; x.strip! > > Smalltalk: x chop; strip. > Ruby (no equivalent) > > In the last version, x is only mentioned once, and the return value of > chop is discarded. I think it could be nice to have something like that in > Ruby. For Ruby2, I'd love to have this too. > Mathieu Bouchard -=- Montr�al QC Canada -=- http://artengine.ca/matju -- Christian Neukirchen http://chneukirchen.org