Jeremy Tregunna
7/27/2006 8:19:00 AM
On 27-Jul-06, at 4:10 AM, rejoc wrote:
> Hello,
>
> I new to Ruby and curious about this language I do use (yeet).
>
> I was browsing through some libraries/modules and I found a line
> looking like
>
> a[:i] ||= "a string"
>
> I could not find this syntax in any manual online (and googling "||
> =" is not of much help :-( )
>
> Can anyone tell me what it means
it will return the value for a[:i] if a value exists, if not, it will
set a[:i] to the value "a string".
--
Jeremy Tregunna
jtregunna@blurgle.ca
"One serious obstacle to the adoption of good programming languages
is the notion that everything has to be sacrificed for speed. In
computer languages as in life, speed kills." -- Mike Vanier