Is there a Perl6 canonical form?

Viewed 166

The Perl6 standard grammar is relatively large. Although this facilitates expression once mastered, it creates a barrier to mastery. For instance, core constructs often have multiple forms supporting different programming paradigms. A basic example is the variety of syntaxes for creating Pairs:

Pair.new('key', 'value'); # The canonical way 
'key' => 'value';         # this... 
:key<value>;              # ...means the same as this 
:key<value1 value2>;      # But this is  key => <value1 value2> 
:foo(127);                # short for  foo => 127 
:127foo;                  # the same   foo => 127

Note, in particular, the comment on the first form: "The canonical way".

Another example is the documentation for method make:

This is just a little sugar for $/.made = $ast which is a very common operation in actions.

Is there a canonical form that one may output for a Perl6 program so that, having mastered the canonical sub-grammar, one may inspect any Perl6 program in that form to comprehend it?

1 Answers
Related