Skip to content

formula classfile#160

Merged
xushiwei merged 1 commit into
xgo-dev:mainfrom
xushiwei:q
Jul 26, 2026
Merged

formula classfile#160
xushiwei merged 1 commit into
xgo-dev:mainfrom
xushiwei:q

Conversation

@xushiwei

Copy link
Copy Markdown
Contributor

No description provided.

@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmp/cmp.go 0.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@xushiwei
xushiwei merged commit 9f020c0 into xgo-dev:main Jul 26, 2026
8 checks passed

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review: formula classfile (Gop → XGo migration)

This is a clean, focused migration renaming the classfile convention Gopt_*_MainXGot_*_Main and GopPackageXGoPackage, plus a demo formula, gox.mod, and .gitignore. The functional rename is complete and correct on the runtime path — the ixgo export.go reflection map keys and the UntypedConsts entry were both updated (that's exactly where a partial rename would break the interpreter at runtime rather than compile time). go build ./... and go test ./formula/... pass. internal/formula test failure is a pre-existing ixgo toolchain linker issue (math/rand/v2.globalRand), unrelated to this PR.

Findings below are consistency / documentation-accuracy issues — nothing blocks correctness.

Stale Gopt_ references left after the rename (not in this diff, but describe the renamed symbol):

  • internal/formula/formula.go:73 — doc-comment example still shows formula.Gopt_ModuleF_Main(this); the symbol no longer exists, so copying the example would fail to compile. Update to XGot_ModuleF_Main.
  • internal/formula/formula.go:81 — prose comment "Calling Main() triggers Gopt_ModuleF_Main…" is now inaccurate.
  • internal/formula/formula.go:143 — inline comment "triggers: formula.Gopt_ModuleF_Main(this)" is now inaccurate.
  • AGENTS.md:51, 94, 106 — still document the Gopt_<ClassName>_Main convention / generated-code shape this PR changed. Worth a follow-up so the migration is complete.

Minor (style): cmp/cmp.go and formula/classfile.go wrap a single constant in a const ( … ) block; the single-line form (const XGoPackage = true) is more idiomatic for a lone constant. Cosmetic only.

See inline comments for the remaining items.

Findings without inline locations

  • formula/classfile_test.go:34: The test body was updated to XGot_ModuleF_Main (line 36) and the failure message on line 39, but the function name TestGopt_ModuleF_Main and the doc comment on lines 31-32 ("exercises…", "Going through Gopt_ModuleF_Main…") still use the old Gopt_ name. Rename to TestXGot_ModuleF_Main and update the comment for consistency with the symbol under test. (Line 109 in this file has the same stale reference.)

Comment thread .gitignore
*.o
*.a
*.so
*.txt

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

*.txt is a very broad ignore pattern. It won't un-track already-committed files, but any newly added .txt will be silently ignored — including build-critical / fixture files this repo relies on (e.g. internal/build/testdata/.../CMakeLists.txt, config.txt, expected-output .txt). That's easy to forget and can produce non-reproducible CI. Recommend scoping it to specific artifact paths. Also, coverage.txt on line 30 becomes redundant once *.txt is present.

Minor: the # gop / # gopfmt / # goptestgo comments on lines 9-11 are stale relative to the XGo migration.

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.

1 participant