Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^13: Near-free function currying in Perl

by BrowserUk (Pope)
on Nov 20, 2004 at 08:58 UTC ( #409237=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    ## $left = 0; $right = 10;
    my $mid = halve( $left + $right ); ## $mid = 5
    ## And maybe?
    my @mids = halve( @left zip @right ); ## ?
    
  2. or download this
    my $mid = ( $left + $right ) / 2;
    my @mids = zip{ ( $_[ 0 ] + $_[ 1 ] ) / 2 } @left, @right;
    
  3. or download this
    add_1( ... );
    add_2( ... );
    ...
    x_div_3_123_456_789_001( ... );
    x_div_3_123_456_789_001_point_1( ... );
    ...
    
  4. or download this
     
        $stopped = 1;
        my $stop = sub { $stopped = 1 if shift() };
    ...
             -command => $stop,
             -accelerator => 's'
        );
    
  5. or download this
    Autocurry qw[ stop ];
    ...
    ...
             -command => stop_c(),
             -accelerator => 's'
        );
    
  6. or download this
       &textfrom := &substr.assuming(str=>$text, len=>Inf);
    
  7. or download this
        $all  = $textfrom(0);   # same as: $all  = substr($text,0,Inf);
        $some = $textfrom(50);  # same as: $some = substr($text,50,Inf);
        $last = $textfrom(-1);  # same as: $last = substr($text,-1,Inf);
    
  8. or download this
       &textfrom := &substr.assuming(str=>$text, len=>Inf);
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://409237]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2019-06-19 01:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Is there a future for codeless software?



    Results (83 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!