On Mon, Jun 16, 2003 at 09:19:22PM +0900, Dominik Werder wrote:
> >kindergarden ||= 0
> >
> >do what you're looking for?
> 
> Yes, it does :)

It does
 a = 0 unless a
instead of
 a = 0 if a < 0
          =====

> But could you tell me where I can read more about this operator?
> google doesn't like the search term "||=" :(

It works like other operators: +=, -=, *=...
and means

 whatever = whatever || rhs

|| will only evaluate the rhs if the lhs is false or nil.

Another implication is that when you define for instance Object#+ you
get += for free. And that

 string += "bla"

creates a new string corresponding to the concatenation of string and
"bla".

-- 
 _           _                             
| |__   __ _| |_ ___ _ __ ___   __ _ _ __  
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ 
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
	Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

- DDD no longer requires the librx library.  Consequently, librx
  errors can no more cause DDD to crash.
	-- DDD