Daniel Amelang
3/22/2005 1:38:00 AM
> with("foo") { reverse } # "oof"
Perhaps I'm confused with your example because it's contrived (on
purpose, I know), but the above makes little sense. It's just a long
way of saying 'foo.reverse'. Or did you mean to use 'reverse!'
This is the way I understood how 'with' would work:
s = "hello"
with(s) {
reverse!
capitalize!
}
p s # Olleh
I'm actually not a big fan of the 'with' idea, or the Object.new {}
one, but I really like 'count'. Could have used it several times the
past couple months.
Dan