Sorry, I didn't mean to imply that C++ had an integrated rx syntax. Rather, that general-purpose speculative assignments/transations were possible with existing features.

I think Perl5 "comprehended" this with the qr// syntax. It's obvious in languages where rx is an ordinary function or class, since backslashes for literal strings are totally independant from metacharacters seen by the function.

Having callable subrules as predicates is something I've waited a long time for. That was the natural idea for me in the late '80's when I played with some ideas. And grammar-writing languages that don't separate yacc and lex concepts work that way.

Having written recursive parsers in C++, Perl, Pascal, and others, it's clear that a "rule" is just a function that consumes input and returns true on a match. Writing that as a sub or a re doesn't matter, and is an intuitive way to do it once re becomes an object that is the "this" of embedded code like we see in P5.

I think it's good when language design progress resonates with common practice. Just let the compiler support it rather than just permit it, and give it awareness of the concepts of our current patterns.

I think Perl 6 will totally displace yacc/lex and other tools for writing grammars.


In reply to Re: Re: hypothetical variables by John M. Dlugosz
in thread hypothetical variables by John M. Dlugosz

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.