# New Ticket Created by  James Keenan 
# Please include the string:  [perl #77220]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=77220 >


The New York City Rakudo Star study group is working its way through  
the Using Perl PDF from Rakudo's github site.  Working through the  
examples in Chapter 4, Subs and Signatures, we believe we have  
identified a case where the code example does not work:

At bottom of page 34, we see:

sub design-ice-cream-mixture(:$name!, $base = 'Vanilla') {
         say "Creating a new recipe named $name!";
     }

design-ice-cream-mixture(name => 'Plain');

FAILS with:

===SORRY!===
Can't put required parameter after variadic parameters at line 3,  
near ") {\n    sa"

However, if we but 'base' before 'name' in the signature, it works:

sub design-ice-cream-mixture($base = 'Vanilla', :$name!) {
         say "Creating a new recipe named $name!";
     }

design-ice-cream-mixture(name => 'Plain');

This works.

Can anyone confirm that it is merely the code exammple on page 34  
which is incorrect?

Thank you very much.

kid51

Reply via email to