in reply to Re^2: Is ": lvalue" attribute usefull or something to avoid?
in thread Is ": lvalue" attribute usefull or something to avoid?
It is possible to validate the values, it's just traditionally a pain in the arse, because it involves using something like Variable::Magic or returning a tied scalar.
Yes. I've done it using a tied scalars, but the penalties -- not just performance, but the obfuscation factor -- makes it a complete non-starter IMO.
none of the implementations are as fast as a more traditionally written accessor.
If the performance penalty was a few percent, the syntactic sugar might be viable; but when it is closer 200% or 300% for subroutines/methods that already have a high overhead to work-done ratio, it simply isn't worth it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Is ": lvalue" attribute usefull or something to avoid?
by tobyink (Canon) on Feb 12, 2014 at 15:05 UTC |