Groups | Search | Server Info | Login | Register


Groups > comp.lang.perl.misc > #24895

Re: on Perl

From Rainer Weikusat <rweikusat@talktalk.net>
Newsgroups comp.unix.shell, comp.unix.programmer, comp.lang.misc, comp.lang.perl.misc
Subject Re: on Perl
Date 2024-04-18 18:09 +0100
Message-ID <87o7a6zjg3.fsf@doppelsaurus.mobileactivedefense.com> (permalink)
References (10 earlier) <uvnerd$1ct1p$1@dont-email.me> <87jzkvor7q.fsf@bsb.me.uk> <uvplme$1rupi$2@dont-email.me> <87le5br16d.fsf@nosuchdomain.example.com> <uvpt9m$2126r$1@dont-email.me>

Cross-posted to 4 groups.

Show all headers | View raw


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. 

Back to comp.lang.perl.misc | Previous | NextPrevious in thread | Find similar


Thread

Re: on Perl Javier <invalid@invalid.invalid> - 2024-04-16 20:47 +0000
  Re: on Perl Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-04-17 03:14 +0000
    Re: on Perl Ben Bacarisse <ben.usenet@bsb.me.uk> - 2024-04-17 18:04 +0100
      Re: on Perl Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-04-17 23:23 +0000
        Re: on Perl Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-04-17 16:59 -0700
          Re: on Perl Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-04-18 01:33 +0000
            Re: on Perl Rainer Weikusat <rweikusat@talktalk.net> - 2024-04-18 18:09 +0100

csiph-web