Skip to content

Minor core differences: main's include/public/private are public, Module#initialize_copy, $FILENAME #138

Closed

Description

@Largo

Small core differences from CRuby 4.0:

  • The main object's include, public and private are public singleton methods; in CRuby they are private.
    p singleton_class.public_instance_methods(false).sort at top level: CRuby [:inspect, :to_s], IronRuby [:include, :inspect, :private, :public, :to_s].
  • Module#initialize_copy on an already-initialized module replaces its methods. CRuby leaves them:
    module M; def foo; end; end; module N; def bar; end; end; M.send(:initialize_copy, N); p M.instance_methods(false). CRuby [:foo], IronRuby [:bar].
  • $FILENAME calls an overridden ARGF#filename: class << $<; def filename; "foo"; end; end; p $FILENAME. CRuby "-", IronRuby "foo".

Found by running the scripts PR #119 deleted (Tests/Experiments, Tests/Legacy) on CRuby 4.0.9 and on IronRuby built from master c7f70cf (net10.0, Linux). (Experiments/Singletons/global.rb, Clone/Module.initialize_copy.rb, Globals/Filename.rb)

Activity

  1. added a commit that references this issue on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions