in reply to Re^3: A tale about accessors, lvalues and ties
in thread A tale about accessors, lvalues and ties
Python does via so called properties. But I don't know any implementation or performance details.
This way simple attributes can be easily turned into mutators without any need to change the API.
> I'm definitely not a fan of lvalue subs or tie.
OK, it seems overcomplicated to do it this way. But IMHO it's stable, has no side-effects and can be hidden behind a nice syntax. It's just slow!
Look, I don't know every archive discussion, so I'm relying on PBP. ... But the reasoning "Don't use lvalue-attributes because you will be forced to use tie afterwards and we showed you earlier that tie is evil" is shallow.
All "earlier arguments" against tie in PBP do not apply with lvalues, except the slowness!
So tuning up tie would solve the whole thing. I mean an alternativ static version hooking wrapper-method directly to variables.
Or does anyone have a good example, where tie profited from resolving methods dynamically and having inheritance and overload and the other OO stuff?
Cheers LanX
|
---|