Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Module#anonymous?. #7966

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ioquatix
Copy link
Member

@ioquatix ioquatix commented Jun 21, 2023

@@ -52,6 +52,14 @@ static inline void ROBJ_TRANSIENT_UNSET(VALUE obj);
*/
VALUE rb_mod_set_temporary_name(VALUE, VALUE);

/**
* Return whether the module is anonymous or not.
Copy link
Contributor

Choose a reason for hiding this comment

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

it might be useful to document what it does for modules with anonymous elements in the "namespace path", e.g.

Class.new.tap { _1::C = Class.new }::C.anonymous? # true or false ?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's still considered anonymous but if we accept this proposal I'll write a full set of specs.

@ko1 ko1 added the Playground Experimental: Post link to try Ruby with PR changes label Jan 16, 2024
Copy link

github-actions bot commented Jan 16, 2024

Try on Playground: https://ruby.github.io/play-ruby?run=10952250729
This is an automated comment by pr-playground.yml workflow.

@nobu
Copy link
Member

nobu commented Jan 16, 2024

Needs tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Playground Experimental: Post link to try Ruby with PR changes
Development

Successfully merging this pull request may close these issues.

4 participants