|
|
|
8.3: What is a class instance variable?
http://faq.rubygarden.org/entry/...r_prefix=faq%
2F
teki |
07/08/09 - 2:09 am | #
|
|
As a python programmer who has only dabbled in perl and ruby I have to say I would *love* to have the ||= (or-equals) operator. It looks funny but once you learn what it does it makes :
if not hasattr(o, 'foo') or not o.foo:
o.foo = "the first value"
... much easier! :
o.foo ||= "the first value"

I also agree about ! and ? suffixes, way more readable.
Kumar McMillan |
Homepage |
07/08/09 - 7:54 pm | #
|
|
|
Commenting by HaloScan
|