The colon marks the invocant of an indirect method call, at least if you're passing parameters. I realize you didn't pass parameters, but I recommend getting in the habit of always using the colon or never using indirect notation.
The purpose of requiring the colon is to disambiguate the language. Indirect object notation fails in difficult-to-debug places in Perl 5 and the goal is to avoid that in Perl 6.
The syntax and semantics of other languages don't really apply. This isn't C++ or Java. It's Perl 6. Unlike both languages, new is not a keyword in Perl 5 or Perl 6. It's a method call.
If Dog.new is a burden, consider using an in-place mutator:
my Dog $ralph .= new();In reply to No (ambiguous) Indirect Object Notation in Perl 6
by chromatic
in thread Tim O'Reilly on Perl
by fauria
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |