GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  CURRY (3)

.ds Aq ’

NAME

curry - Create automatic curried method call closures for any class or object

CONTENTS

SYNOPSIS



  use curry;

  my $code = $obj->curry::frobnicate(foo);



is equivalent to:



  my $code = sub { $obj->frobnicate(foo => @_) };



Additionally,



  use curry::weak;

  my $code = $obj->curry::weak::frobnicate(foo);



is equivalent to:



  my $code = do {
    Scalar::Util::weaken(my $weak_obj = $obj);
    sub {
      return unless $weak_obj; # in case it already went away
      $weak_obj->frobnicate(foo => @_)
    };
  };



RATIONALE

How many times have you written



  sub { $obj->something($some, $args, @_) }



or worse still needed to weaken it and had to check and re-check your code to be sure you weren’t closing over things the wrong way?

Right. That’s why I wrote this.

AUTHOR

mst - Matt S. Trout (cpan:MSTROUT) <mst@shadowcat.co.uk>

CONTRIBUTORS

None yet - maybe this software is perfect! (ahahahahahahahahaha)

COPYRIGHT

Copyright (c) 2012 the curry AUTHOR and CONTRIBUTORS as listed above.

LICENSE

This library is free software and may be distributed under the same terms as perl itself.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 CURRY (3) 2012-09-09

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.