From: Ilias Lazaridis Date: 2005-04-03T21:54:45+09:00 Subject: Re: [EVALUATION] - E03 - jamLang Evaluation Case Applied to Ruby Robert Klemme wrote: [...] >> [i like this language *very* much] >> >> - >> >> But to understand this fully, can someone please decrypt this: >> >> def meta() >> @meta ||= {} >> end > > If @meta is something false (i.e. nil or false) then the expression on > the right hand side is evaluated and the result is assigned to @meta. > It's short for any of these > > @meta = {} unless @meta > @meta || (@meta = {}) > @meta or @meta = {} > > {} creates a hash (synonym for Hash.new, but you can also put values > there like {"foo"=>"bar"}). ok you answer together with the other answer => i got it: def meta() # use of "()" is optional unless @meta # if @meta == nil ("unless" is the same as "if not") @meta = {} # creates a new hash end @meta # returns the hash end .. -- http://lazaridis.com