[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: default values of 'false' in data description
- From: Shmuel Zeigerman <shmuz@...>
- Date: Wed, 13 Sep 2006 20:49:44 +0200
Thomas Blom wrote:
If I want the parameter "loop" for a sound to default to true when
unspecified I thought I would write:
shouldLoop = sounds.loop or true -- (nil or true) => true
but then it doesn't work for the second entry:
shouldLoop = sounds.loop or true -- (false or true) => true
This was a bit of a surprise, since (nil or false) => false.
What's the elegant idiom for this situation?
shouldLoop = sounds[i].loop == nil