You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The defined operator isn't marked as foldable in regen/opcodes. Not sure why - because it would break something, or trying to avoid spending compile time on something that probably isn't going to be foldable very often?
Activity
p5pRT commentedon Nov 21, 2017
From @bulk88
The defined operator on a constant should be folded, it isn't. The 9 is folded, but it stops at the defined operator.
If I do a different expression
The correct branch is correctly removed. Another example
Perl Info
richardleach commentedon Jun 1, 2025
The defined operator isn't marked as foldable in regen/opcodes. Not sure why - because it would break something, or trying to avoid spending compile time on something that probably isn't going to be foldable very often?
richardleach commentedon Jun 1, 2025
After a quick test run, setting defined to be foldable does cause failures, but I haven't looked into them yet.
richardleach commentedon Jun 1, 2025
Ran on the wrong branch. There are actually no test failures and folding does work.
And on the original example: