Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    Sub::DeferredPartial 0.01

    Download button

    No screenshots available
    Downloads: 275  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Steffen Goeldner | More programs
    Perl Artistic License / FREE
    May 3rd, 2007, 21:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Sub::DeferredPartial description

    Sub::DeferredPartial is a deferred evaluation / partial application.

    Sub::DeferredPartial is a deferred evaluation / partial application.

    SYNOPSIS

    use Sub::DeferredPartial 'def';

    $S = def sub : P1 P2 P3 { %_=@_; join '', @_{qw(P1 P2 P3)} };

    print $S->( P1 => 1, P2 => 2, P3 => 3 )->(); # 123

    $A = $S->( P3 => 1 ); # partial application
    $B = $S->( P3 => 2 );

    $C = $A + $B; # deferred evaluation

    $D = $C->( P2 => 3 );
    $E = $D->( P1 => 4 );

    print $E->(); # force evaluation: 863

    $F = $E - $D;

    $G = $F->( P1 => 0 ) / 2;

    print $G->(); # 400
    print $G; # ( ( CODE(0x15e3818): P1 => 4, P2 => 3, P3 => 1 + CODE ...

    $F->(); # Error: Free parameter : P1
    $A->( P3 => 7 ); # Error: Bound parameter: P3
    $A->( P4 => 7 ); # Error: Wrong parameter: P4

    An instance of this class behaves like a sub (or, more precisely: subroutine reference), but it supports partial application and the evaluation of operators applied to such function objects is deferred too.

    That means, evaluation has to be forced explicitly (which makes it easier to add introspection capabilities).

    Objects that represent deferred (delayed, suspended) expressions are known as suspensions or thunks in various programming circles. Don't confuse with the same terms in the context of threads!

    Requirements:

    · Perl



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    evaluation application | partial application | Perl module | Sub::DeferredPartial | evaluation | partial

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM