You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Zajal's modules get included into the Sketch class here lib/core/sketch.rb. This is beneficial and avoids namespace pollution, but breaks code like this
classParticledefdraw# Particle can't see Graphics#cirlcle, because Graphics wasn't included into itcircle@x,@y,20endenddrawdop=Particle.newp.drawend
The text was updated successfully, but these errors were encountered:
I did some research, but I haven't found anything yet. I'd love to see if there's a way to overwrite Class generation, so each time a Class is defined, we automatically define #method_missing. So if a user writes circle, and it's not defined in the class, our method_missing picks up on it, and is able to defer it to Graphics if possible. Not sure.
Otherwise, we'll just have to communicate that you need to include Graphics if you're doing graphics in your class.
Zajal's modules get
include
d into theSketch
class here lib/core/sketch.rb. This is beneficial and avoids namespace pollution, but breaks code like thisThe text was updated successfully, but these errors were encountered: