Index index by Group index by Distribution index by Vendor index by creation date index by Name Mirrors Help Search

perl-asa-1.04-1.22 RPM for noarch

From OpenSuSE Ports Tumbleweed for noarch

Name: perl-asa Distribution: openSUSE:Factory:zSystems
Version: 1.04 Vendor: openSUSE
Release: 1.22 Build date: Wed Jul 31 07:35:13 2019
Group: Development/Libraries/Perl Build host: reproducible
Size: 32018 Source RPM: perl-asa-1.04-1.22.src.rpm
Packager: https://bugs.opensuse.org
Url: https://metacpan.org/release/asa
Summary: Lets your class/object say it works like something else
Perl 5 doesn't natively support Java-style interfaces, and it doesn't
support Perl 6 style roles either.

You can get both of these things in half a dozen different ways via various
CPAN modules, but they usually require that you buy into "their way" of
implementing your code.

Other have turned to "duck typing".

This is, for the most part, a fairly naive check that says "can you do this
method", under the "if it looks like a duck, and quacks like a duck, then
it must be a duck".

It assumes that if you have a '->quack' method, then they will treat you as
a duck, because doing things like adding 'Duck' to your '@ISA' array means
you are also forced to take their implementation.

There is, of course, a better way.

For better or worse, Perl's '->isa' functionality to determine if something
is or is not a particular class/object is defined as a *method*, not a
function, and so that means that as well as adding something to you '@ISA'
array, so that Perl's 'UNIVERSAL::isa' method can work with it, you are
also allowed to simply overload your own 'isa' method and answer directly
whether or not you are something.

The simplest form of the idiom looks like this.

  sub isa {
      return 1 if $_[1] eq 'Duck';
      shift->SUPER::isa(@_);
  }

This reads "Check my type as normal, but if anyone wants to know if I'm a
duck, then tell them yes".

Now, there are a few people that have argued that this is "lying" about
your class, but this argument is based on the idea that '@ISA' is somehow
more "real" than using the method directly.

It also assumes that what you advertise you implement needs to be in sync
with the method resolution for any given function. But in the best and
cleanest implementation of code, the API is orthogonal (although most often
related) to the implementation.

And although '@ISA' is about implementation *and* API, overloading 'isa' to
let you change your API is not at all bad when seen in this light.

Provides

Requires

License

Artistic-1.0 OR GPL-1.0-or-later

Changelog

* Wed Jul 31 2019 Stephan Kulow <[email protected]>
  - updated to 1.04
    see /usr/share/doc/packages/perl-asa/Changes
* Mon Oct 16 2017 [email protected]
  - spec file
    + add "BuildRequires:  perl-Module-Install" to fix perl 5.26 build
* Mon Apr 13 2015 [email protected]
  - updated to 1.03
    see /usr/share/doc/packages/perl-asa/Changes
* Mon Apr 13 2015 [email protected]
  - updated to 1.03
    see /usr/share/doc/packages/perl-asa/Changes
* Tue Nov 30 2010 [email protected]
  - switch to perl_requires macro
* Mon Nov 29 2010 [email protected]
  - remove /var/adm/perl-modules
* Fri Nov 05 2010 [email protected]
  - initial package (0.02)

Files

/usr/lib/perl5/vendor_perl/5.40.0/asa.pm
/usr/share/doc/packages/perl-asa
/usr/share/doc/packages/perl-asa/CONTRIBUTING
/usr/share/doc/packages/perl-asa/Changes
/usr/share/doc/packages/perl-asa/README
/usr/share/licenses/perl-asa
/usr/share/licenses/perl-asa/LICENSE
/usr/share/man/man3/asa.3pm.gz


Generated by rpm2html 1.8.1

Fabrice Bellet, Tue Dec 3 23:45:09 2024