From: Nat Pryce Date: 2002-05-17T22:36:03+09:00 Subject: Re: ||= operator From: "Berger, Daniel" > This is a perl-ism that I use from time to time: ||= > e.g. > s = String.new > s ||= "hello" > This is just shorthand for: > s = "hello" if s.nil? > Any chance of adding this? Or is this too difficult to parse? irb(main):001:0> p= nil nil irb(main):003:0> p ||= "Hello" "Hello" irb(main):005:0> p ||= "Goodbye" "Hello" irb(main):006:0> Cheers, Nat. ________________________________ Dr. Nathaniel Pryce B13media Ltd. Studio 3a, Aberdeen Business Centre, 22/24 Highbury Grove, London, N5 2EA http://www.b13media.com