Hi,

I have tried most of the examples in the Wrap Chapter in S6, and I kept 
gettting a

"Not enough positional parameters passed; got 0 but expected 1" error message.

Try the following code:

sub thermo ($t) { say "t is $t in thermo"; }  
&thermo.wrap( { callwith( ($^t-32)/1.8 ) } );
say &thermo(12);

Furthermore, "temp" is treated as a sub (!) ("could not find sub '&temp'").

For instance,

sub thermo ($t) { say "t is $t in thermo"; }  
#&thermo.wrap( { callwith( ($^t-32)/1.8 ) } ); 
temp &thermo.wrap( { callwith($^t + 273.16) } );
say &thermo(12);

 
Regards,

Philippe



----- Mail transféré -----
De: phi...@free.fr
À: perl6-bugs-follo...@perl.org
Envoyé: Lundi 30 Avril 2012 11:34:51
Objet: Re: [perl #112676] SUPER does not seem to work

Hi,

the S6 and S12 docs are not very clear on how to use nextsame to call super 
methods, etc.

Could you please provide examples of how to call the superclass's constructor?
Furthermore, I can't get the below code to work.

Many thanks.

Best regards,

Philippe

-------------
class cell {
        has Int $.contents = 0;
}
class reCell is cell {
        has Int $.backup = 0;
        method new(Int $contents) {
                backup => $contents;
                contents => $contents;
        }
}

my $reCell = reCell.new(contents => 2);

print $reCell.contents;




----- Mail original -----
De: "Moritz Lenz via RT" <perl6-bugs-follo...@perl.org>
À: phi...@free.fr
Envoyé: Lundi 30 Avril 2012 09:44:48
Objet: [perl #112676] SUPER does not seem to work 

There is no SUPER. And the WALK syntax you are using is purely
imaginary, and not backed by the spec. See S06 for nextsame and friends
about how to do the stuff you want to do.

Reply via email to