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, BranoThread Previous | Thread Next