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

Re^2: Perl 6 and Perl 5 parsing

by TimToady (Parson)
on Jan 14, 2011 at 21:01 UTC ( #882415=note: print w/replies, xml ) Need Help??


in reply to Re: Perl 6 and Perl 5 parsing
in thread Perl 6 and Perl 5 parsing

Interestingly, because Perl 5's mutability under sub declarations was so confusing to people; Perl 6's sub declarations never mutate the grammar. Apart from explicit macros or mixed-in grammar rules, the only thing that can change the grammar is a constant declaration, which declares a word that never takes arguments, much like a 0-ary sub in Perl 5. (Type declarations may be considered a specialized kind of constant declaration, where the constant being declared just happens to be a type.) In Perl 6, there are no barewords, so any unrecognized word is assumed to be a list operator that will be declared later in the same file.

So while Perl 6's grammar is more mutable in theory; it is less frequently mutated by accident.

Another interesting consequence of this decision is that the blocks supplied to map and grep are not a special syntax, so they require a comma. Likewise use of & in a sub signature does not change parsing. On the other hand, bare blocks are just anonymous closures in Perl 6, so they can be passed in any position, and are not restricted to the first argument as they are with Perl 5's & prototype.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://882415]
help
Chatterbox?
[Tux]: but I <3 the way people test here
[Tanktalus]: Tux: use sort -V to sort your perls. Looks much nicer that way ;)
[Tux]: Hmmm, pm-cb-g does not seem to accept dead-key diacriticals as all my other (perl) applications do. choroba?
[Tux]: Tanktalus this was the output of autocompletion in my tcsh
[erix]: ah, but I have different compilation- versions of Pg too, so double that: 26 * 2 = more than 50 :P
[Tanktalus]: When I showed one of my coworkers my perl list, he told me that my sort routine was broken when 5.8.8 showed up after 5.26.0 ... which made me investigate sort, which is when I found this option :)
erix atm running billion row table replication (pg-)tests...
[Tanktalus]: Tux: ah, still... :)
Tux writes mail to tcsh developers ...
Tanktalus snickers :)

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (11)
As of 2017-09-25 16:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (284 votes). Check out past polls.

    Notices?