Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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.


In reply to Re^2: RFC: Is there more to alias? (cases) by xmath
in thread RFC: Is there more to alias? by xmath

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-20 00:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found