tobyink / p5-type-tiny

Perl 5 distribution Type-Tiny; see homepage for downloads and documentation.
https://typetiny.toby.ink/
54 stars 48 forks source link

`${^TYPE_PARAMS_MULTISIG}` is a reserved variable #120

Closed haarg closed 2 years ago

haarg commented 2 years ago

Quoting from perlvar:

These variables are reserved for future special uses by Perl, except for the ones that begin with ^ (caret-underscore). No name that begins with ^ will acquire a special meaning in any future version of Perl; such names may therefore be used safely in programs.

This variable should probably be renamed. As this is part of the Type::Params API, just removing the existing variable probably isn't possible, but at least a different form should be supported and documented.

There has been some discussion on Perl/RFCs#22 about trying to apply strict to variable of this form, which could prevent their use in the future.

tobyink commented 2 years ago

I probably should add an underscore.

haarg commented 2 years ago

You have some other modules using names like this: Kavorka has ${^NEXT} in its API, and uses ${^ONE} and ${^MYVAR} in tests. Moops uses Kavorka's ${^NEXT}. Acme::Loopy uses ${^LOOP}.