Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^6: Why should any one use/learn Perl 6?

by jeffenstein (Hermit)
on Jun 11, 2018 at 19:33 UTC ( [id://1216429]=note: print w/replies, xml ) Need Help??


in reply to Re^5: Why should any one use/learn Perl 6?
in thread Why should any one use/learn Perl 6?

Maybe I'm just unlucky, but on my Windows desktop for work I couldn't get any of the standard fixed-width fonts to display this glyph. I tried it in both gvim and putty, with no luck.

Does Perl 6 normalize the code points (like Unicode::Normalize) before it parses the code? haj might have answered that question

  • Comment on Re^6: Why should any one use/learn Perl 6?

Replies are listed 'Best First'.
Re^7: Why should any one use/learn Perl 6?
by liz (Monsignor) on Jun 11, 2018 at 20:25 UTC

      Thanks for the link. I didn't see anything in there about normalizing the source code in particular, but did try a test case with the 2018.05 version of Perl 6 with good results, in case anybody is interested:

      $ cat t.p6 #!/usr/bin/env perl6 my $charé = "asdf"; if $charé { say "It Works!"; } $ perl6 t.p6 It Works!

      The source:

      $ grep \$char t.p6 | od -c 0000000 m y $ c h a r 303 251 = " a +s 0000020 d f " ; \n i f $ c h a r e 314 20 +1 0000040 { \n 0000043

      After parsing:

      $ perl6 --target=parse t.p6 | head | grep \$char | od -c 0000000 m y $ c h a r 303 251 = " a +s 0000020 d f " ; \n i f $ c h a r 303 251 0000040 { \n - E X P R : m +y 0000060 $ c h a r 303 251 = " a s d +f 0000100 " \n 0000102

        Thank you for trying!

        FWIW, there's nothing special about Perl 6 source code: when you run a script foo.pl, it's basically

        "foo.pl".IO.slurp.EVAL

        or if you're more procedurally inclined

        EVAL slurp "foo.pl"

        So the source code is handled exactly the same as any other source of text: assumed to be encoded in UTF-8 (by default) and thus normalized using synthetic graphemes if necessary. Also note that CRLF is such a synthetic grapheme

        say "\r\n".chars; # 1

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2024-04-19 06:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found