|
Posted by Els on 12/20/06 14:07
Tim Streater wrote:
> In article <15270vgkskofw$.ex7bxqbswi4v.dlg@40tude.net>,
> Els <els.aNOSPAM@tiscali.nl> wrote:
>
>> I'm just looking for a way to write the following in a shorter way:
>> if ($a == 1 || $a == 2 || $a == 3 || $a == 4 || $a == 17 || $a == 30)
>>
>> Something that equates to "if $a == one of ((1 - 4), 17, 30)"
>
> I'd be inclined to leave it as it is, and let the interpreter optimise
> it. That's its job, after all. As you've written it it's quite clear
> what you intend.
It's just that I'm not worried about what the interpreter needs to do,
but what *I* need to do. (lazy typist me ;-))
--
Els http://locusmeus.com/
Navigation:
[Reply to this message]
|