From: Trans Date: 2007-12-19T13:17:14+09:00 Subject: Re: Using 'when' as a statement modifier On Dec 18, 8:55 pm, MonkeeSage wrote: > On Dec 18, 7:41 pm, Trans wrote: > > > > > On Dec 18, 6:20 pm, MonkeeSage wrote: > > > > On Dec 17, 10:31 pm, Tom Agnew wrote: > > > > > Hello all, > > > > > I have a suggestion for an enhancement that could add to the readability > > > > of my programs. > > > > > I'm a frequent user of 'if' and 'unless' statement modifiers. It's a > > > > beautiful abbreviation that enhances the readability of my code. > > > > > Here is a pattern that I use from time to time: > > > > > result = func(x) unless func(x)==y > > > result = z unless (z = func(x))==y > > > However I sort of like the idea, and even better: > > > result = func(x) when y > > > T. > > Nice. Slight correction... > > result = z unless (z = func(x))==y > > result = z if (z = func(x))==y > ^^ Ah, right. Hmm... if is to unless as when is to ? T.