S06 shows how to define named-only parameters, "marked with a prefix :".  But 
no example shows anything more than a bare parameter name.  No type is ever 

Looking through my copy of STD.pm, I'm baffled, as it seems not to take types 
in parameter lists at all.

So, is it
  method bytes ( Encoding :$encoding ) returns Int


  method bytes ( : Encoding $encoding ) returns Int


I'm guessing that the latter would be confused with use of : after the 
invocant, and it follows that

  method bytes (Encoding :encoding($override_encoding)) returns Int

would work.

Reply via email to