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

Re^2: RFC: Is there more to alias? (cases)

by xmath (Hermit)
on Aug 24, 2004 at 22:56 UTC ( #385538=note: print w/ replies, xml ) Need Help??


in reply to Re: RFC: Is there more to alias? (cases)
in thread RFC: Is there more to alias?

Ehh, hmmm, alias-ifying someone else's code? I can already smell the sulphurous fumes of the dragons that await you down that road. Most likely you'd manage to break something by doing that, and even if it miraculously works, it could very well break when the module is updated. I've just examined some Heap module to imagine what would happen.. at the very least all subs that operate on the heap (directly or indirectly) would need to be aliasified to have any chance of working correctly. I really wouldn't go down this road.

So, this also answers simply how to retrofit a module to store aliases: always use aliasing internally, and make a copy at the API boundary when aliasing is not desired.

Your swap and exchange are both fine and functionally equivalent, the cases you suggest work. Note that you can omit the 'do' in exchange, since alias BLOCK is valid syntax.


Comment on Re^2: RFC: Is there more to alias? (cases)
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://385538]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2014-10-02 00:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (41 votes), past polls