hybridgroup / kidsruby

KidsRuby is a Ruby programming environment meant for kids to learn and have fun!
http://kidsruby.com
Other
333 stars 104 forks source link

Use fully qualified constant names #101

Open silkycove opened 11 years ago

silkycove commented 11 years ago

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 commented 11 years ago

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 commented 11 years ago

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 commented 10 years ago

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 ::