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.20 RPM for noarch

From OpenSuSE Tumbleweed for noarch

Name: perl-asa Distribution: openSUSE Tumbleweed
Version: 1.04 Vendor: openSUSE
Release: 1.20 Build date: Fri Feb 2 17:19:06 2024
Group: Development/Libraries/Perl Build host: i04-ch2c
Size: 32017 Source RPM: perl-asa-1.04-1.20.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 <coolo@suse.com>
  - updated to 1.04
    see /usr/share/doc/packages/perl-asa/Changes
* Mon Oct 16 2017 ncutler@suse.com
  - spec file
    + add "BuildRequires:  perl-Module-Install" to fix perl 5.26 build
* Mon Apr 13 2015 coolo@suse.com
  - updated to 1.03
    see /usr/share/doc/packages/perl-asa/Changes
* Mon Apr 13 2015 coolo@suse.com
  - updated to 1.03
    see /usr/share/doc/packages/perl-asa/Changes
* Tue Nov 30 2010 coolo@novell.com
  - switch to perl_requires macro
* Mon Nov 29 2010 coolo@novell.com
  - remove /var/adm/perl-modules
* Fri Nov 05 2010 pascal.bleser@opensuse.org
  - initial package (0.02)

Files

/usr/lib/perl5/vendor_perl/5.38.2/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, Sat Mar 30 23:40:51 2024