Correct Evaluate-in-Hold test expectation for empty Evaluate[]#27
Merged
Conversation
Hold[Evaluate[], 1+1] was asserted to yield Hold[2], but an empty Evaluate[] splices away (-> Sequence[]) without forcing its siblings: only an Evaluate directly heading a held slot overrides Hold for that slot. This mirrors the passing non-empty case Hold[Evaluate[1+1], 2+2] -> Hold[2, 2+2] -- an empty Evaluate cannot have more reach than a non-empty one. The evaluator already produced the correct Hold[1 + 1]; only the assertion was wrong. Corrected it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hold[Evaluate[], 1+1]was asserted to yieldHold[2], but that expectation is incorrect per Wolfram semantics — the evaluator was already right (Hold[1 + 1]). This corrects the sole failing assertion inevaluate_tests.Changes
tests/test_evaluate.c: change the expected value ofHold[Evaluate[], 1+1]fromHold[2]toHold[1 + 1], with an explanatory comment.Rationale
An empty
Evaluate[]splices away (-> Sequence[]) but does not force its siblings.EvaluateoverridesHoldonly when it is directly the head of a held slot. This is consistent with the passing non-empty caseHold[Evaluate[1+1], 2+2] -> Hold[2, 2+2]: an emptyEvaluatecannot have more reach than a non-empty one. No engine/behavior change — test-only.Testing
evaluate_testsnow exits 0 (was aborting on this assertion); confirmed it was the only failing assertion.Ticket
beads-planning-0c8