ist als string vorgegeben. Ich will ein Programm der das auswertet
Nennt sich symbolische Mathematik.
REPL-Sitzung:
⌨➤ my $tree = Math::Symbolic->parse_from_string('(1.0+0)')
bless({
operands => [
bless({
special => '',
value => '1.0'
} => 'Math::Symbolic::Constant' ),
bless({
special => '',
value => '0'
} => 'Math::Symbolic::Constant' )
],
type => 0
} => 'Math::Symbolic::Operator' )
⌨➤ my ($coderef) = Math::Symbolic::Compiler->compile_to_sub($tree)
sub {
package Math::Symbolic::Compiler;
use warnings;
use strict;
1;
}
⌨➤ $coderef->()
1
PS: Da der "dringenden Hilfe" nun Abbitte getan wurde, und dank des Codes auf dem CPAN trotzdem noch genug Zeit übrig ist, etwas zu sagen, so lasse mich denn sagen: die Kinder lernen heute einfach nix mehr in der Schule.
PPS: Get off my lawn.