Well. You have it right. I do know only how the XS functions are interfaced with perl and I base my assumptions on this knowledge. I'm not going to check perl sources to see if perl has different stack discipline for pure perl functions. After all it is not important for me since I write either in perl or extensions for perl. And if you know how the things are really handled, fine with me. It does not affect my work, for perl programs it makes no difference how the internal stack is handled :)

The example of a way to return array from the function was not a way to "cling". This whole discussion has started after your statement, that there's no way to return an array in perl. So I just gave an example when the array is returned from the function. Whatever internal steps are done for this are not of a concern for me at this point. In our arguing about how things are done internally we have forgotten, why the arguing has started in the first place :)


In reply to Re^12: Confused as to why the "casting context" is mis-behaving (clinging) by andal
in thread Confused as to why the "casting context" is mis-behaving by kiz

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.