From: Csaba Henk Date: 2005-03-22T11:14:51+09:00 Subject: Re: strip and its evil brother strip! On 2005-03-22, Mathieu Bouchard wrote: > The above form saves you that local assignment: >> "ab#{foo}de"[1..3].instance_eval { chop!; strip! } > > The problem with it, compared to the smalltalk one, is that it changes the > scope of instance-variables. That's true. #instance_eval is not the same as what Smalltalk has, but in the 90% percent of the cases when you'd just like to quickly throw some thunks at the object in a line, it pretty well does the job. > >> 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. > > I often use "i" as an abbreviation for instance. I write "ivar" instead of > "instance variable". Even the C/Ruby API calls them that way. However, the > subtext of such a phrase annoys me. It suggests a binary opposition that > asserts the supremacy of the classes over other objects, and effectively > even ejects the name "object" in favour of some statement of dependency > (it's always about being an instance _of_ something). I'd rather have them > called "object variables" or "ovar" but if not then i can accept "ivar" as > long as i don't de-abbreviate it. Even then, you don't mention using "ieval" :) >> It's not even some weirdo which is justified to have weird name >> because of its weirdness. > > Weirdness is in the eye of the beholder... you see, some people have Sure, what I spoke above is just my personal feeling. > learnt from the Church of JAVA (tm) that eval is evil and dirty (Ruby has [...] > (oh, and if you're not following my postmodernist reasonings, i'm sorry.) I liked them... Church of Java, sounds as mystic and exciting and terrifying as the pirates with their treasures and iron hook hands and half eye and wooden legs when I was a child :) Csaba