Acme-Lambda-Expr

 view release on metacpan or  search on metacpan

lib/Acme/Lambda/Expr/Operators.pm  view on Meta::CPAN

493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
        my $operand  = $self->operand;
        return sub{ abs &{$operand} };
}
__PACKAGE__->meta->make_immutable();
 
use Moose;
extends qw(https://metacpan.org/pod/Acme::Lambda::Expr::UniOp">Acme::Lambda::Expr::UniOp);
 
sub symbol{
        return q{log};
}
sub codify{
        my $self = shift;
        my $operand  = $self->operand;
        return sub{ log &{$operand} };
}
__PACKAGE__->meta->make_immutable();
 
use Moose;
extends qw(https://metacpan.org/pod/Acme::Lambda::Expr::UniOp">Acme::Lambda::Expr::UniOp);
 
sub symbol{
        return q{sqrt};
}

lib/Acme/Lambda/Expr/Term.pm  view on Meta::CPAN

43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
        cmp  _str_compare
 
        !    _not
        neg  _negate
        ~    _complement
 
        cos    _cos
        sin    _sin
        exp    _exp
        abs    _abs
        log    _log
        sqrt   _sqrt
        int    _int
        atan2  _atan2
 
);
 
sub compile{
        my($self) = @_;
        my($pkg, $file, $line) = caller;
        my $context = qq{package $pkg\n#line $line $file\n;};

lib/Acme/Lambda/Expr/Term.pm  view on Meta::CPAN

182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
}
sub _sin{
        return Acme::Lambda::Expr::Sin->generate(@_);
}
sub _exp{
        return Acme::Lambda::Expr::Exp->generate(@_);
}
sub _abs{
        return Acme::Lambda::Expr::Abs->generate(@_);
}
sub _log{
        return Acme::Lambda::Expr::Log->generate(@_);
}
sub _sqrt{
        return Acme::Lambda::Expr::Sqrt->generate(@_);
}
sub _int{
        return Acme::Lambda::Expr::Int->generate(@_);
}
 
__PACKAGE__->meta->make_immutable;

tool/operators.pl  view on Meta::CPAN

106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
{
        my @uniops = (
                _not        => '!',
                _negate     => 'neg',
                _complement => '~',
 
                _cos   => 'cos',
                _sin   => 'sin',
                _exp   => 'exp',
                _abs   => 'abs',
                _log   => 'log',
                _sqrt  => 'sqrt',
                _int   => 'int',
        );
 
        while(my($name, $uniop) = splice @uniops, 0, 2){
                my $class_name = 'Acme::Lambda::Expr::'
                        . join '', map{ ucfirst } split /_/, $name;
 
                if($uniop eq 'neg'){
                        $uniop = '-';



( run in 0.662 second using v1.01-cache-2.11-cpan-ba35b6b0368 )