Hi -- On Wed, 29 Sep 2004, Mauricio FernáÏdez wrote: > On Wed, Sep 29, 2004 at 05:37:21AM +0900, David A. Black wrote: > > Hi -- > > > > On Wed, 29 Sep 2004, stevetuckner wrote: > > > > > I often use the ||= idiom in ruby for late initialization. But was > > > recently looking for an idiom that would allow me to overwrite a > > > variable if the right side is defined without repeating myself. > > > > > > I have used the following: > > > > > > var = val if val > > > > > > but I have to repeat val and that violates DRY. > > > > $ ruby -e 'a = b if b' > === > a Ummmm, no. Look at Steve's code again. David -- David A. Black dblack / wobblini.net