On 2005-03-20, Mathieu Bouchard <matju / sympatico.ca> wrote: > 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) There _is_ equivalent of this in ruby, it's just it's not sugared: x.instance_eval { chop; strip } But you can see that this form makes difference semantically: without it you should do s = "ab#{foo}de"[1..3] s.chop! s.strip! The above form saves you that local assignment: "ab#{foo}de"[1..3].instance_eval { chop!; strip! } I wonder why isn't #instance_eval sugared. It's a very useful method, and I think only its ugly lengthy names keeps it away from becoming one of the most basic rubyisms. It's not even some weirdo which is justified to have weird name because of its weirdness. Eg., it could be just aliased to Kernel#do. (Don't tell me that "do" also being a keyword is a problem while we have this also with "class" [that one annoys me more that this would].) Let's get a visual impression of it: x.do { chop!; strip! } I like it... Csaba