in reply to Re: Implicit references? module -> feature -> pragma -> "Perl8" ?
in thread Implicit references? module -> feature -> pragma -> "Perl8" ?
You know the implementation side better than me, that's why I proposed different implementations/semantics.
The first version is a naive (but easy) implementation with the pitfall that both variables could later diverge.
To catch this a naive implementation would either need to make the ref $a readonly or use a tie to update \@a (here are dragons)
(I "think" a POC for testing could be implemented with Keyword::Simple)
The second version would be ideal, because diverging is ruled out. But I'm not sure if it's even possible to implement this in a performant way and what the repercussions would be.
An alternative syntax could be
mine $a = [1,2,3];
Of course all of this requires testing many use cases with POCs before going live.
Legacy code would continue working and new code become much easier.
I doubt many people reuse the same symbol name in different sigil/types.
Style guides require arrays and hashes to have self describing names, so it would be obvious that $dictionary is the reference of %dictionary .
Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Implicit references? module -> feature -> pragma -> "Perl8" ?
by Anonymous Monk on May 12, 2026 at 21:04 UTC | |
by LanX (Saint) on May 12, 2026 at 22:59 UTC | |
by hippo (Archbishop) on May 13, 2026 at 09:16 UTC | |
by LanX (Saint) on May 13, 2026 at 12:22 UTC | |
by LanX (Saint) on May 13, 2026 at 13:36 UTC | |
by Anonymous Monk on May 12, 2026 at 22:10 UTC |