Active object: Difference between revisions

Content added Content deleted
(→‎{{header|Perl 6}}: Add a Perl 6 example)
m (→‎{{header|Perl 6}}: use full (non-simplified ) function for sine)
Line 1,668: Line 1,668:
my $a = Integrator.new;
my $a = Integrator.new;


$a.Input( sub ($t) {sin(pi * $t) } );
$a.Input( sub ($t) { sin(2 * π * .5 * $t) } );


say "Initial value: ", $a.Output;
say "Initial value: ", $a.Output;