develooper Front page | perl.perl5.porters | Postings from June 2022

Re: Pre-RFC: Improve “wide character” warnings

Thread Previous | Thread Next
From:
Branislav Zahradník
Date:
June 8, 2022 08:39
Subject:
Re: Pre-RFC: Improve “wide character” warnings
Message ID:
CAB=rbOm-gJp0hMS5wYybiEc+fVLEsQi0AhpgXZKVCHqUQVkx4w@mail.gmail.com
On Wed, 8 Jun 2022 at 09:05, Alexander Hartmaier <alex.hartmaier@gmail.com>
wrote:

> Can we please skip the string-using intermediate step and go right to how
> Python does it with exception classes?
>
>
There already was such discussions
- https://www.nntp.perl.org/group/perl.perl5.porters/2021/06/msg260676.html

Regarding exception classes, I though that as as well, introducing classes
with overloaded stringify should do the trick
but I was told otherwise (I don't remember enough to find that discussion
as well, maybe it was on IRC)
so result: behaviour of "if (ref $@)" to detect perl and custom exception
will change

As result, I also played with internals with implementation of stash-to-sv
relation (so -> operator can call methods even on non-refs)
that is possible but raises another problem (if you are in "cannot do"
mood) - it will prohibit "$class->method"

This can be mitigated by two approaches:
a) limit this behaviour to exceptions
b) introduce mandatory usage of class literal (ie, requires new internals)

Syntax
- My::Package:: - already supported, treated specially but producing
BAREWORD token
- ${var}:: - new syntax, convert dynamic string into class literal

Class literal can still be allowed to use indirect syntax (especially with
"new" and "throw")

Best regards,
Brano

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