From: Hugh Sasse Staff Elec Eng Date: 2000-07-04T14:39:06+01:00 Subject: [ruby-talk:03796] Re: Array.uniq! returning nil On Tue, 4 Jul 2000, [iso-8859-1] Aleksi Niemel� wrote: > And, now the new trick, add Array.uniq!? which would work like current > Array.uniq!. The actual semantic hint the developer should get when he sees > obj.method!? is 'this method modifies the object and returns something > (possibly boolean) describing if any action was taken'. Is this a more idiomatic solution? irb(main):014:0> example = "hello\n" "hello\n" irb(main):015:0> example.display() hello nil irb(main):016:0> (example.chomp! || example).display hellonil irb(main):017:0> (example.chomp! || example).display hellonil irb(main):018:0> Hugh hgs@dmu.ac.uk