SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG

 
 

perl-Perl6-Currying rpm build for : OpenSuSE. For other distributions click perl-Perl6-Currying.

Name : perl-Perl6-Currying
Version : 0.05 Vendor : obs://build_opensuse_org/devel:languages:perl
Release : lp155.8.1 Date : 2023-07-20 18:23:32
Group : Development/Libraries/Perl Source RPM : perl-Perl6-Currying-0.05-lp155.8.1.src.rpm
Size : 0.02 MB
Packager : https://www_suse_com/
Summary : Perl 6 subroutine currying for Perl 5
Description :
The Perl6::Currying module lets you try out the new Perl 6 explicit
higher-order function syntax in Perl 5.

In Perl 6 any subroutine can be \"partially bound\". That is, you can supply
some of its arguments and thereby create another subroutine that calls the
original with those arguments automatically supplied.

Subroutine parameters are partially bound by calling the \'prebind\' method
on the subroutine. This method call returns a reference to a new subroutine
that calls the original subroutine, inserting into its argument list the
prebound arguments. For example:


sub divide ($numerator, $denominator) {
return $numerator / $denominator;
}

my $halve = ÷.prebind(denominator=>2);

Note that it\'s necessary to use the \'&\' sigil to indicate that the method
\'CODE::prebind\' is to be called on a \'CODE\' object \'÷\', not the
\'Whatever::prebind\' of the \'Whatever\' object returned by _calling_
\'divide\'. To get the latter, we would write:

divide().prebind(...)

or:

divide.prebind(...)

Having prebound the denominator, if we now call the subroutine referred to
by \'$halve\' the effect is to call \'divide\' with an automagically supplied
denominator of 2. That is:


print divide(42,2); # calls ÷...prints 21
print $halve(42); # calls ÷...prints 21

It\'s also possible to prebind _all_ the arguments of a subroutine, either
all at once:


my $pi_approx = ÷.prebind(numerator=>22,denominator=>7);

print $pi_approx(); # prints 3.14285714285714

or in stages:


my $pi_legislated = $halve.prebind(numerator=>6);

print $pi_legislated(); # prints 3

Note that we _didn\'t_ need the \'&\' sigil before \'$halve\' since this syntax
is unambiguously a call (through a reference to a \'CODE\' object) to
\'CODE::prebind\'.

You can also use the Perl 6 aliasing operator (\':=\') to create new named
subroutines by partially binding existing ones. For example:



&reciprocal := ÷.prebind(numerator=>1);

print reciprocal(10) # prints 0.1

RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-P/15.5/noarch

Content of RPM  Provides Requires

Download
ftp.icm.edu.pl  perl-Perl6-Currying-0.05-lp155.8.1.noarch.rpm
     

Provides :
perl(Perl6::Currying)
perl-Perl6-Currying

Requires :
perl(:MODULE_COMPAT_5.26.1)
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1


Content of RPM :
/usr/lib/perl5/vendor_perl/5.26.1/Perl6
/usr/lib/perl5/vendor_perl/5.26.1/Perl6/Currying.pm
/usr/lib/perl5/vendor_perl/5.26.1/Perl6/demo.pl
/usr/lib/perl5/vendor_perl/5.26.1/Perl6/demo_indir.pl
/usr/lib/perl5/vendor_perl/5.26.1/x86_64-linux-thread-multi
/usr/share/doc/packages/perl-Perl6-Currying
/usr/share/doc/packages/perl-Perl6-Currying/Changes
/usr/share/doc/packages/perl-Perl6-Currying/README
/usr/share/man/man3/Perl6::Currying.3pm.gz

 
ICM