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

Use fully qualified constant names #101

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

Conversation

silkycove
Copy link
Contributor

Reference: http://ruby-dev.info/posts/43365 (fixed in 1.9.3)
It should be safe to use fully-qualified constant names in the block passed to instance_eval.

@deadprogram
Copy link
Member

It should be safe, but it does also make the code more "wordy" for the very young, plus the need to enter the extra colons. Are you sure this is such a good thing?

@silkycove
Copy link
Contributor Author

No, I am not sure. I agree that the code must be simple. The issue is 1.9.3 (and 1.8.7) causes NameError when we pass FORWARD and other constant names without the prefix (Sphero::) in the block. According to Bug# 4536: http://ruby-dev.info/posts/43365, the behaviour of 1.9.2 (no error) is incorrect and fixed in 1.9.3. My worry is if kids are confused by the difference between Ruby versions.
Defining FORWARD and others in the local scope of the example code might be an alternate solution.

@hunterboerner
Copy link
Contributor

I think that if one has a sphero and is able to connect it up then they are able to learn the great powers of ::

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.

3 participants