From: Carlos Date: 2001-12-23T10:50:54+09:00 Subject: [ruby-talk:29333] Re: a better way? > I was writing a little code that cached a function value, and wound up > with this: > > result = @@save[self] > return result if result > > I don't see a way to do it in one line unless I'm willing to do the > lookup twice. Am I missing something? result = @@save[self] and return result ? or if result = @@save[self] then return result; end ? But the two lines seem clearer to me...