Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^5: what would you like to see in perl5.12?

by BrowserUk (Patriarch)
on Aug 26, 2007 at 12:58 UTC ( [id://635124]=note: print w/replies, xml ) Need Help??


in reply to Re^4: what would you like to see in perl5.12?
in thread what would you like to see in perl5.12?

with everything based on a single C<Q> and a bunch of adverbs

I don't understand what you mean by "based on a single c<Q>"?

And I'd just point out that the adverbs could still be used with "...{{ code }}:x ...".


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^6: what would you like to see in perl5.12?
by blazar (Canon) on Aug 26, 2007 at 14:13 UTC
    I don't understand what you mean by "based on a single c<Q>"?

    <joke>It is not in my realm of competence to know whether you understand or not.</joke>

    Seriously, to quote from Synopsis 2:

    And I'd just point out that the adverbs could still be used with "...{{ code }}:x ...".

    Adverbs within the quoted material? A completely different thing: adverbs on (quote-like) operators define how the "language" in the quoted material is interpreted. What you're talking about would be a feature specific of one such language. (Speaking of which I suppose it will be possible to define your own parser switching adverbs, along with an appropriate parser.)

      So q is really short for Q:q and qq is short for Q:qq.

      Oh. So all that flowery prose,

      Oh no! Perl 6's new quoting mechanism, with everything based on a single C<Q> and a bunch of adverbs is just breathtaking: it is at same time simple, intuitive and powerful as familiar constructs like C<q> and C<qq> will remain very much the same as in Perl 5 and a terrible amount of more flexibility will be available at the tiny expense of appending a semicolon and a few letters.

      is just breathless hot air admiration, but completely orthogonal to the point I was making.

      Ie. I was discussing the definition of the "language" that can appear inside one of those long-winded substitutes for the simple quote-like operators that we already have. (And that no doubt Perl6Critic will adjudge it to being the moral equivalent of walking around with your fly unbuttoned if you don't use the long form; and a few individuals will adopt derigeur because they think it looks cute :)

      I re-read Syn2 last week before posting this suggestion, and it strikes me that with all the stuff that can now appear inside double-quotes, it's easier to just backwack everything that isn't special, than work out what is. The old thing of "this is all just string constant except for a few bits that will be runtime substituted" has been turned on it's head.

      And it will be impossible for editors, even those that are thinly disguised OSs, to highlight the difference between the passive and active bits. Ie. They will be unable to assist the (maintenance) programmer in working out which bits of string constants are actually constant and which are not.

      I can see myself adopting the use of single quoted constants interspersed with concatenated variables and expressions, in order to make it clear what is constant and what not. So complex have the rules become.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        is just breathless hot air admiration, but completely orthogonal to the point I was making.

        First of all ++, because I saw your post in Worst Nodes, and I don't think it deserves being, since however may I disagree with it, it's well written and thought

        [...] inside one of those long-winded substitutes for the simple quote-like operators that we already have. (And that no doubt Perl6Critic will adjudge it to being the moral equivalent of walking around with your fly unbuttoned if you don't use the long form; and a few individuals will adopt derigeur because they think it looks cute :)

        (emphasis added by me)

        I can't understand what you want to imply with the contraposition of "long-winded" and "long form" on one side and "simple" on the other one. I don't see how "..." and '...' are more complex than err, well, "..." and '...' respectively, with just the former having in Perl 6 some more and more reasonable interpolating power.

        Is it that bad that in addition to

        my $email = $user . '@location.wtf';

        or

        my $email = "$user\@location.wtf";

        I can also write

        my $email = qs($user@location.wtf); # ?

        Personally, I find it very clear and perhaps the least confusing of the three.

        And it will be impossible for editors, even those that are thinly disguised OSs, to highlight the difference between the passive and active bits. Ie. They will be unable to assist the (maintenance) programmer in working out which bits of string constants are actually constant and which are not.

        I am fond of syntax highlighting: indeed I have set up an association in my editor for certain extensions and when I happen to mistype the latter on launching sometimes I start writing and only after a few lines do I realize I did, as if awakening from a dream while saying: is this stuff that I've written Perl? But as I wrote, personally I don't find that kind of assistance from the editor to be particularly valuable. Indeed if it highlighted variables interpolated into strings it would be distracting for me: just too many colors dancing in front of me. To each his own I suppose.

        Anyway nothing but perl can parse Perl, and although Perl 6 is more orthogonal and consistent than Perl 5, this is not going to change. Indeed it will be promoted to: nothing but Perl can parse Perl. So no editor will ever do a perfect job of Perl syntax highlighting, but it may come close. Yours may just highlight {...} blocks: you may stick to that and your editor do a decent hob with them. OTOH I've heard rumors about the possibility of a perl interpreter to editor/ide communication for better management including syntax highlighting and other stuff.

        I can see myself adopting the use of single quoted constants interspersed with concatenated variables and expressions, in order to make it clear what is constant and what not. So complex have the rules become.

        For simple strings the rules are more or less as they are. The added complexity in more general cases is not that much, and anyway doesn't come at a price not worth the gain...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://635124]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2024-03-29 09:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found