Scripsit ille aut illa TAKAHASHI Masayoshi <maki / rubycolor.org>:
[...]
> class Foo
>   def initialize
>     @bar = 1
>   end
>   def bar=(x)
>     p "bar= called"
>     @bar = x
>   end
>   def bar
>     p "bar called"
>     @bar
>   end
> end
[...]
> ex.1  foo.bar ||= 1
> "bar called"

(and if foo.@bar was false, bar= would also have been called)

> ex.2  foo.bar = foo.bar || 1
> "bar called"
> "bar= called"
> 
> ex.3  foo.bar = foo.bar ? foo.bar : 1
> "bar called"
> "bar called"
> "bar= called"

(and if foo.@bar was false, foo.bar would only have been called once)


-- 
[mpg123d] Just playing: .../a/11 Dance with me... Saigo no Paradise.mp3
bash$ echo QUIT | nc news.t-online.de nntp
200 T-Online Newsserver bereit [06] (posting ok).
205 All your base are belong to us.