Name : perl-Sub-PatternMatching
| |
Version : 1.04
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : lp154.6.1
| Date : 2023-01-27 18:02:14
|
Group : Development/Libraries/Perl
| Source RPM : perl-Sub-PatternMatching-1.04-lp154.6.1.src.rpm
|
Size : 0.02 MB
| |
Packager : https://www_suse_com/
| |
Summary : Functional languages\' Pattern Matching for Perl subs
|
Description :
Sub::PatternMatching implements \"Pattern Matching,\" a programming idiom often found in functional languages like Haskell or OCaml. Pattern Matching refers to functions that do different things for different arguments. It is often referred to as polymorphism as well.
The syntax is currently a bit convoluted taking away much from the benefit of readability by replacing nested if-else constructs with pattern matching. This is supposed to be fixed in a later release, but maintaining backward-compatibility.
To construct a pattern matching subroutine, you assign the result of a call to the \'patternmatch()\' subroutine that is exported by the module to a scalar or symbol table entry. \'patternmatch()\' returns an anonymous function.
The arguments to \'patternmatch()\' are expected to be pairs of array or hash references and code references like this:
C< [ ...pattern... ] => sub { ...implementation... }> or C< { ...pattern... } => sub { ...implementation... }>
If the pattern applies to the function arguments, the corresponding code reference will be called with the original arguments.
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-S/15.4/noarch |