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

Implement Binding#local_variables and Binding#receiver #3354

Closed

Conversation

ruipserra
Copy link
Contributor

This is a follow-up of #3352.

In summary:

  • Binding#receiver: I took @jemc's advice and renamed the @self ivar to @receiver. To avoid breaking other code, selfis kept as a virtual attribute.
  • Binding#local_variables: Created the local_variablesmethod in Rubinius::VariableScope, which is used both in Kernel.local_variables and Binding#local_variables.

Comments and feedback welcome. Thanks for your time 😄


def self
@receiver
end
Copy link
Member

Choose a reason for hiding this comment

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

Do we even need to keep #self and #self= around?

If it's not part of a Ruby-language-compatibility contract, and only Rubinius internal code uses these, can we just make them attr_accessor :receiver instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

@jemc Wouldn't that make it set @self again instead?

@yorickpeterse
Copy link
Contributor

This has been merged into 59d6f28 (had to do a rebase first to keep the logs clean, so GH didn't notice).

@jemc
Copy link
Member

jemc commented Mar 11, 2015

I guess I'll see about the self cleanup myself then and do it in another commit.

@jemc jemc closed this Mar 11, 2015
@ruipserra
Copy link
Contributor Author

Thanks! @jemc You're right that #self and #self= aren't really needed, but I didn't want to start ripping things apart without first checking with you guys.

@ruipserra ruipserra deleted the implement_new_binding_methods branch March 11, 2015 19:02
@jemc
Copy link
Member

jemc commented Mar 11, 2015

@ruipserra
No worries, thanks for working on this!

@jemc
Copy link
Member

jemc commented Mar 11, 2015

Addressed the #self/#self= concerns in ccf1686

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.

None yet

3 participants