Skip to content

Implement top-level define_method - #430

Merged
tannevaled merged 1 commit into
mainfrom
feat/cluster8
Aug 23, 2026
Merged

tannevaled merged 1 commit into
mainfrom
feat/cluster8

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

At the top level, define_method raised NoMethodError because main
had no such method. main's singleton class now gets define_method,
forwarding to Object's Module#define_method (Object is the top-level
default definee): define_method(:m){…} defines Object#m and returns
the method name.

Verified against ruby 4.0.6; core/main/define_method_spec now passes
3/3. A full language+core sweep shows +3 with no regressions and the
whole-suite coverage gate stays at 100.0%.

(A top-level include was prototyped too but deferred: making it
actually mix a module into Object — correct MRI behaviour — shifts
constant resolution enough to regress core/module/constants_spec, so
it needs a separate look.)

🤖 Generated with Claude Code

At the top level `define_method` raised NoMethodError, because `main`
had no such method. main's singleton class now gets `define_method`,
forwarding to Object's Module method (Object is the top-level default
definee): define_method(:m){…} defines Object#m and returns the method
name.

Verified against ruby 4.0.6; core/main/define_method_spec now passes 3/3.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 5d4d39b into main Aug 23, 2026
7 checks passed
@tannevaled
tannevaled deleted the feat/cluster8 branch August 23, 2026 19:51
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