I am uncertain if I should update my previous node or not. As I am attacking a seperate portion of this, I believe I am correct in making a new node.

sub myimport($exp_from : *@symbols=() : *@options=())
What does this do? I have been over the related Apocalypse and Exegesis ( part 3 ) and I think the idea here is to allow myimport to be called with lists instead of arrays.

According to TheDamian in Exegesis 3, page 1, the @ will cause perl6 to expect either an array or an array reference as the parameter. If we were to declare a perl6 sub like this:

sub foo( @bar )
and called it like this:
&foo( "a", "b" );
we would generate an error ( at compile time? ).

If we really want foo to be called with a list, we need to put the flattening star in the sub definition:

sub foo( *@bar )

But, later on in the same tome, we are told that this will have the standard perl5 affect of slurping the remainder of the parameters.

I am guessing this to be an error on BrentDax's part. I believe BrentDax was attempting to allow myimport to be called with lists, but forgot that the flattening star would behave exactly as we expect from perl5. If I have missed something, I would really appreciate being corrected.

update: Changed a bit of wording in the last paragraph. Mik
mikfire


In reply to Re: Poor Man's Perl6 Exegesis (you get what you pay for) by mikfire
in thread Poor Man's Perl6 Exegesis (you get what you pay for) by Ovid

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.