Sujet : Re: on Perl
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.unix.shell comp.unix.programmer comp.lang.misc comp.lang.perl.miscDate : 18. Apr 2024, 00:59:06
Autres entêtes
Organisation : None to speak of
Message-ID : <87le5br16d.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Lawrence D'Oliveiro <
ldo@nz.invalid> writes:
On Wed, 17 Apr 2024 18:04:57 +0100, Ben Bacarisse wrote:
Perl has had support for object-oriented programming (with multiple
inheritance) for many years -- too many for me to remember.
>
Then why this new “class” thing in 5.38?
It's explained reasonably well at the top of the "perldoc perlclass"
documentation in Perl 5.38:
History
Since Perl 5, support for objects revolved around the concept of
*blessing* references with a package name. Such reference could then be
used to call subroutines from the package it was blessed with (or any of
its parents). This system, while bare-bones, was flexible enough to
allow creation of multiple more advanced, community-driven systems for
object orientation.
Class feature is a core implementation of class syntax which is familiar
to what one would find in other programming languages. It isn't a
"bless" wrapper, but a completely new system built right into the perl
interpreter.
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comWorking, but not speaking, for Medtronicvoid Void(void) { Void(); } /* The recursive call of the void */