bug(#5165): rename Ph* objects, batch bindings, drop PhCopy#5172
Merged
yegor256 merged 2 commits intoMay 27, 2026
Conversation
Rename PhMethod to PhDispatch and PhWith to PhApplication. PhApplication now accepts several bindings at once through the new Bind value object, so to-java.xsl emits a single application with multiple Bind arguments instead of nesting one application per binding. Remove PhCopy: the copy that isolates an object before its bindings are applied now happens once inside PhApplication, while dispatch copying stays in AtWithRho.
Contributor
🚀 Performance AnalysisAll benchmarks are within the acceptable range. No critical degradation detected (threshold is 100%). Please refer to the detailed report for more information. Click to see the detailed report
|
Adjust MjTranspileTest packs to the new generated output: PhMethod is now PhDispatch, PhWith is PhApplication with Bind arguments (batched per object), and the explicit PhCopy line is gone since the copy moved into PhApplication.
|
Member
Author
|
@yegor256 please check |
|
@maxonfjvipon Great work on your contribution! 🎉 You've earned +4 points (+16 base, -4 for 922 hits-of-code ≥ 100, -8 for 922 ≥ 400). Quality over quantity helps maximize your rewards! Your total score is now +165 - check your Zerocracy account for details. |
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
PhMethod→PhDispatchandPhWith→PhApplication(runtime, tests, andto-java.xsl).PhApplicationnow accepts several bindings at once via a newBindvalue object (positional or named).to-java.xslemits a singlenew PhApplication(r, new Bind(0, …), new Bind(1, …))instead of nesting one application per binding. The single-pair constructors delegate to the varargs one.PhCopy. The copy that isolates an object before its bindings are applied now happens once insidePhApplication(copy the receiver, then apply all binds) — exactly mirroring the oldPhCopy(receiver)+ bindings. Dispatch copying remains handled byAtWithRho, soPhDispatchis a plain take.head(0->a,1->b)and still collapses literal number/string constructions to their values.Test plan
mvn -Pqulice verifyis cleanEOgoTest,EOwhileTest,EOmallocTest) — copy-on-application semantics preservedGroundwork for the pure-objects cache; related to #5165.