From: matz@... (Yukihiro Matsumoto) Date: 2001-05-30T15:42:26+09:00 Subject: [ruby-talk:16012] Re: new keyword idea: tryreturn, tryturn or done Hi, In message "[ruby-talk:15954] new keyword idea: tryreturn, tryturn or done" on 01/05/30, Juha Pohjalainen writes: ||---------------------------------------------------------- || def doSomethingWith value || result = tryFirstThing value || return result if result || makeSomePreparations value || result = trySomethingElse value || return result if result || raise TypeError, "could not do it" || end ||---------------------------------------------------------- | |Or what do you think? | ||---------------------------------------------------------- || def doSomethingWith value || tryturn tryFirstThing value || makeSomePreparations value || tryturn trySomethingElse value || raise TypeError, "could not do it" || end ||---------------------------------------------------------- def doSomethingWith value return tryFirstThing value || (makeSomePreparations value; trySomethingElse value) || raise(TypeError, "could not do it") end or def doSomethingWith value return tryFirstThing value || (makeSomePreparations value; trySomethingElse value or raise TypeError, "could not do it") end matz.