Nevertheless, skynight is correct that Perl 5 contains some fundamental semantic traps. But it is also the case that we have not hesitated to break any existing surface feature of Perl 5 in order to target those deep traps. Perl 6 is simultaneously a better Perl and a completely new language, because it still depends critically on context, but completely revamps how (and when) context works, hopefully in a way that will seem even more Perlish in the long run.

Many of the traps in Perl arise because of colliding contexts, and we've tried very hard to arrange contexts in Perl 6 so they don't collide so often, and when they do, they prioritize in the expected fashion. That's why there really aren't very many keywords to speak of anymore, so you can override print if you want to, because any lexical or package scope takes precedence over the global scope in which print is defined. That's why we now distinguish modules and classes from packages, and methods from subroutines, so the compiler can know the intent of the programmer better. That's why we revamped the precedence tables to get rid of longstanding traps inherited from C. That's why patterns are now considered a real language, and not just interpolated strings. That's why scalar context no longer forces premature evaluation. It all comes down to linguistics, and more specifically, tagmemics. Every utterance has multiple contexts, and it's really important to keep track of which context is "working" at any particular spot.


In reply to Re^2: Some Insights from a Traveler Between Languages by TimToady
in thread Some Insights from a Traveler Between Languages by skyknight

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.