develooper Front page | perl.perl5.porters | Postings from December 2021

Re: No implicit coercion?

Thread Previous | Thread Next
From:
Paul LeoNerd Evans
Date:
December 29, 2021 00:21
Subject:
Re: No implicit coercion?
Message ID:
YcuqD0KoU484llFA@genoa.dictatorshipcake.co.uk
On Tue, Dec 28, 2021 at 10:07:38AM -0600, David Nicol wrote:
> as type coercion is the feature -- it's on a plain Perl, but it's still a
> feature -- the "PMAW" for anyone who remembers those e-mails twenty years
> ago -- how about invoking this mode with C<no coercion> instead of C<use
> explicit> ?

I already wrote an idea of `no stringification` a while ago:

  https://metacpan.org/release/PEVANS/stringification-0.01_004

Having (a? another?) pragma to disallow reference->number conversions,
and string<->number conversions might also be useful.

I don't think theabove implementation is good though - to work nicely it
really must be a core feature. This is one of those ideas that can be
experimented with in a syntax way as a CPAN module, but actual
implementation really does require core.

-- 

Paul "LeoNerd" Evans

leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About