Sub-DeferredPartial

 view release on metacpan or  search on metacpan

lib/Sub/DeferredPartial.pm  view on Meta::CPAN

}
# -----------------------------------------------------------------------------
sub new
# -----------------------------------------------------------------------------
{
  my $class = shift;
  my $Sub   = shift;
  my $Free  = shift;
  my $Bound = shift || {};

  bless { Sub => $Sub, F => $Free, B => $Bound } => $class;
}
# -----------------------------------------------------------------------------
sub Subify
# -----------------------------------------------------------------------------
{
  my $self = shift;

  return sub { return @_ ? $self->Apply( @_ ) : $self->Eval };
}
# -----------------------------------------------------------------------------

lib/Sub/DeferredPartial/Op/Binary.pm  view on Meta::CPAN

sub new
# -----------------------------------------------------------------------------
{
  my $class = shift;
  my $Op    = shift;
  my $Op1   = shift;
  my $Op2   = shift;

  confess "Operator '$Op' not implemented" unless exists $Ops{$Op};

  bless { Op => $Op, Op1 => $Op1, Op2 => $Op2 } => $class;
}
# -----------------------------------------------------------------------------
sub Apply
# -----------------------------------------------------------------------------
{
  my $self  = shift;
  my %Args  = @_;
  my $Free  = $self->Free;
  my %Args1 = (); my $n1 = 0; my $Free1 = $self->{Op1}->Free;
  my %Args2 = (); my $n2 = 0; my $Free2 = $self->{Op2}->Free;

lib/Sub/DeferredPartial/Op/Nullary.pm  view on Meta::CPAN

use Sub::DeferredPartial(); @ISA = 'Sub::DeferredPartial';
use Carp;

# -----------------------------------------------------------------------------
sub new
# -----------------------------------------------------------------------------
{
  my $class = shift;
  my $Op    = shift;

  bless { Op => $Op } => $class;
}
# -----------------------------------------------------------------------------
sub Apply
# -----------------------------------------------------------------------------
{
  my $self = shift;

  confess 'Apply not possible';
}
# -----------------------------------------------------------------------------

lib/Sub/DeferredPartial/Op/Unary.pm  view on Meta::CPAN

# -----------------------------------------------------------------------------
sub new
# -----------------------------------------------------------------------------
{
  my $class = shift;
  my $Op    = shift;
  my $Op1   = shift;

  confess "Operator '$Op' not implemented" unless exists $Ops{$Op};

  bless { Op => $Op, Op1 => $Op1 } => $class;
}
# -----------------------------------------------------------------------------
sub Apply
# -----------------------------------------------------------------------------
{
  my $self = shift;

  return ref( $self )->new( $self->{Op}, $self->{Op1}->Apply( @_ ) );
}
# -----------------------------------------------------------------------------

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.399 second using v1.00-cache-2.02-grep-82fe00e-cpan-9e6bc14194b )