Since Perl6 will treat any code as "old code" unless it starts with one of the new keywords...
That's not quite right. Perl 6 will treat code as Perl 5 code if (and only if) the first executable line in the program is a package statement.

And, yes, we're going to need some way to distinguish Perl 6 code from Perl 5 code. Because there are a few simple cases that mean completely different things in Perl 5 and Perl 6. For example:

print $hash{bang};

In Perl 5 that means: print the value of the entry of %hash whose key is "bang".

In Perl 6 that means: print the value of the entry of the hash referred to by $hash whose key is "bang".

How could we distinguish Perl 5 and Perl 6 code? I'd suggest we add a <code6> flag and have the monastery render code marked as Perl 6 in a different font. For example, the submission:

    We're going to need some way to distinguish:
    
    <code>
        print $hash{bang};  # entry 'bang' of hash %hash
    </code>
    
    from:
    
    <code6>
        print $hash{bang};  # entry 'bang' of hash %{$hash}
    </code6>
might be rendered:
We're going to need some way to distinguish:
    print $hash{bang};  # entry 'bang' of hash %hash
from:
    print $hash{bang};  # entry 'bang' of hash %{$hash}

Note: I've used a red-shift/blue-shift visual pun here, but in reality we'd need to use distinct font faces -- perhaps serif for Perl 5 and sans-serif for Perl 6 -- so as not to disadvantage those with impaired colour vision.

Using a separate mark-up tag would also support those monks who (through necessity or by choice) use a non-visual browser.


In reply to Re: Re: SOP6W by TheDamian
in thread SOP6W by rir

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.