Skip to content

Conversation

tonycoz
Copy link
Contributor

@tonycoz tonycoz commented Mar 18, 2021

Unlike other features, the work for this is done at runtime, but we only get to this point when autovivification is needed, so I expect the total cost is small enough not to matter.

The only real way to eliminate all the cost would be to have alternate ops that don't autovivify, since an op flag would have about the same runtime cost.

The runtime-ness of this feature revealed a bug in my original work that reflected feature changes to %^H to PL_compiling.cop_features - the cop_features value wasn't being copied to the next/dbstate op. This was (fortunately) harmless since current features only work at compile-time (using PL_compiling), and other feature tests that anyone outside of core might want to do need to check the hinthash value from caller().

tonycoz added 2 commits March 18, 2021 14:37
All current features are compile-time, so this hasn't been an issue,
but my current implementation of the autovivification issue checks
features at runtime, which failed to work correctly if non-bundle
features were set.
This throws an error instead of performing autovivification when
the feature is disabled.
default, but can be turned off to disable it.
This feature is available under this name from Perl 5.34 onwards, in
previous versions it was simple on all the time.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simply*

@xenu
Copy link
Member

xenu commented Mar 18, 2021

Personally, I expected this to work like no autovivification instead of throwing an exception.

@Leont
Copy link
Contributor

Leont commented Mar 18, 2021

Personally, I expected this to work like no autovivification instead of throwing an exception.

Yeah. I'm not sure we really need this feature, but fatal non-autovivification is definitely not something I think we need.

@tonycoz tonycoz marked this pull request as draft March 21, 2021 22:44
@tonycoz
Copy link
Contributor Author

tonycoz commented Mar 21, 2021

I was mostly thinking of it as a strictness check, throwing when perl would otherwise autovivify, as if the variable was a nil object or similar.

I've made this PR draft for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants