> -----Original Message----- > From: dave / thomases.com [mailto:dave / thomases.com]On Behalf Of Dave Thomas > Sent: Tuesday, February 27, 2001 4:04 PM > To: ruby-talk ML; ruby-talk / netlab.co.jp > Subject: [ruby-talk:11681] Re: assert() library in Ruby? > > > "Aristarkh A Zagorodnikov" <xm / w3d.ru> writes: > > > > DEBUG = false # or true > > > > > > def assert > > > if DEBUG > > > result = yield > > > raise "Assertion failed" if !result > > > end > > > end > > def assert > > raise 'assertion failed' unless yield if DEBUG > > end > > Well, if brevity trumps clarity, > > def assert > DEBUG && !yield && raise('assertion failed') > end Don't want to start a flame ;), but clarity of my example is better ;)) Just read it in english ;))) Aristarkh A Zagorodnikov, Lead Programmer, W3D Group http://www.w3d.ru /// xm / w3d.ru /// ICQ UIN 36987938