3 ms·
This is mainly caused by the false intuition that @foo ||= bar actually expands to @foo = @foo || bar which, to many a surprise, is not th
by tantalor 15y ago
This is mainly caused by the false intuition that
@foo ||= bar
actually expands to
@foo = @foo || bar
which, to many a surprise, is not the case.
Hardly a "false intuition", since that is how this syntax works in other languages, e.g., perl[1].
[1] http://docstore.mik.ua/orelly/perl/prog3/ch03_17.htm http://docstore.mik.ua/orelly/perl/prog3/ch03_17.htm