Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re^9: Experimenting with Lvalue Subs (trade-offs)

by fergal (Chaplain)
on Jan 25, 2005 at 16:28 UTC ( #424919=note: print w/replies, xml ) Need Help??

in reply to Re^8: Experimenting with Lvalue Subs (trade-offs)
in thread Experimenting with Lvalue Subs

Actually I think your :sassign idea is implementable now using attributes. When you hit a sub with that attr you just need to whip it out and replace it with a sub that returns a tie which calls the original with the extra lvalue argument. Obviously you'd not be happy with the implementation but it would be worth doing just to be able to play with your sassign idea and see if you like it.

Yes, for the rare cases, it increases the number of calls. For the common cases, it can reduce the number of calls and complexity.
Increasing the number of calls is not just an efficiency issue, it's potentially a correctness issue, calling twice when previously we called once could do something nasty.
  • Comment on Re^9: Experimenting with Lvalue Subs (trade-offs)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://424919]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2018-06-24 23:07 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.