Open silkycove opened 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?
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.
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 ::
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.