Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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]
[Corion]: Heh. Perl heredocs are nasty - Filter::Simple doesn't know whether the line continued after the heredoc or not. The heredoc payload starts on the next line.
[Corion]: So currently, Filter::Simple mangles your code/line numbers if you use heredocs ;)

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2017-01-22 10:19 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (187 votes). Check out past polls.