Arc Forumnew | comments | leaders | submitlogin
2 points by Pauan 5150 days ago | link | parent

I didn't really think of prototypes in the same way as scope, but you're right that they're basically the same thing. I suppose you could say that prototypical inheritance is scope applied to objects, rather than functions.

With that in mind, I'm curious whether prototypes would even be useful in Arc. I don't use them much in JavaScript, preferring to use plain old objects/variables/closures.

In any case, this was more of a theoretical exercise than a practical idea. It was basically me realizing that I could implement prototypes in a language that doesn't have prototypes, by using a function.

I then realized that since Arc is so malleable, I might even be able to extend the built-in eval to treat my special prototype functions as if they were hash tables. That, unfortunately, didn't work out, but I suspect I can do it with Anarki.