Re: on Perl

Liste des GroupesRevenir à clp misc 
Sujet : Re: on Perl
De : rweikusat (at) *nospam* talktalk.net (Rainer Weikusat)
Groupes : comp.unix.shell comp.unix.programmer comp.lang.misc comp.lang.perl.misc
Date : 18. Apr 2024, 18:09:32
Autres entêtes
Message-ID : <87o7a6zjg3.fsf@doppelsaurus.mobileactivedefense.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
On Wed, 17 Apr 2024 16:59:06 -0700, Keith Thompson wrote:
>
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:
>
It says there is already supposed to be a mechanism for this, it doesn’t
explain why that isn’t good enough.

There's a mechanism for method dispatch in class hierarcies. There's no
builtin support whatsoever for handling class instance data (or class
data, for that matter). This has certain advantages (everything a
reference refers to can be used as object, eg, file handles) and is
reasonably easy to provide for cases without multiple inheritance and
doable otherwise. OTOH, that absolutely not what people familiar with
other programming languages expect and also beyond what many of them can
wisely handle. Hence, a more dictatorial approach is probably expected
to improve things¹.

¹ Somewhat questionable when looking at another newer feature, namely,
subroutine signatures. It would be absolutely great if perl support real
function prototypes including checking function invocations for
correctness at compile time *and* *not* at runtime everytime a
function is called.

Date Sujet#  Auteur
17 Apr 24 * Re: on Perl6Lawrence D'Oliveiro
17 Apr 24 `* Re: on Perl5Ben Bacarisse
18 Apr 24  `* Re: on Perl4Lawrence D'Oliveiro
18 Apr 24   `* Re: on Perl3Keith Thompson
18 Apr 24    `* Re: on Perl2Lawrence D'Oliveiro
18 Apr 24     `- Re: on Perl1Rainer Weikusat

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal