Don't ask to ask, just ask | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
My whole point here is that the term "lvalue subroutine" has been taken to mean "the same thing as VB/Java properties." But its not. Larry is solving a different problem to that which we care about: simple syntactic sugar so we can write things like
and have them be some sensible equivelent method call. Id say that few of us care if we can use such a sub as a slot in a list assignment, or if we can take a ref to the "value" the property represents or if we can localize it (how the hell you localize a change that may have massive sideffects is beyond me). We dont care about weird stuff like that much, we dont even care much if $o->prop++ gets translated to two method calls. (If we were really concerned about such things we probably wouldnt be using Perl at all.) We want the side effects, we want validation, it would be nice if we could handle list and scalar assignment in a single sub, but bottom line we just want the syntactic sugar and we really dont want to have to create ties for it every time. In fact it seems to me that ties arent even appropriate as there isnt any efficient way via a tied interface to do things like set a full array in a single go, instead it gets translated into zillions of STORE calls. Hmm, actually thinkign about it further i can imagine cases where a tied approach flat out wont work at all. How do you do something like
With a tied/lvalue interface?
--- demerphq In reply to Re^10: Experimenting with Lvalue Subs
by demerphq
|
|