From: Daniel Brockman Date: 2005-07-25T11:37:24+09:00 Subject: Re: FAQ? Hash concatenation "David A. Black" writes: >> def compensate(defaults) >> defaults.merge self >> end > > I'm curious what this gains you. Is it better than just > saying defaults.merge(self)? Good point. Come to think about it, I doubt if I ever used the non-destructive variant. I guess depending on your taste it could be nicer when defaults is a hash literal and self isn't. def foo1(options) bar { :moomin => 123 }.merge(options) end def foo2(options) bar options.compensate(:moomin => 123) end The former is shorter and uses standard operations only, but the latter is arguably conceptually simpler once you get used to the compensate method. Also, you could argue that if there's a ‘compensate!’, then there should also be a ‘compensate’. But yeah... :-) -- Daniel Brockman So really, we all have to ask ourselves: Am I waiting for RMS to do this? --TTN.