So we have prototypes (self & JavaScript) and classes (sometimes added to JavaScript).
JavaScript prototypes are very different from Self prototypes.
Is there another way?
Yep. Object constructors from Emerald (like Javascripts' { } notation for objects) and concatenation rather than delegation or inheritance.
see e.g. http://lively.cs.tut.fi/publications/TR6-JavaScriptConcatenation-Taivalsaari...
or more generally http://www.cs.tut.fi/~taivalsa/publications.html
or more recently "Object Inheritance Without Classes" - Tim Jones et al http://homepages.ecs.vuw.ac.nz/~tim/publications/ecoop16-object-inheritance....
James
James,
Thanks for chiming in. I started reading your paper and love that you reference Alan Borning’s work. Cannot finish the paper right now, but will look forward to that.
Yes, there are many ways. I don’t know of a single best way. Lately, I’ve been programming in Swift, and have allowed it to teach me something new, as well as rekindle my friendship with APL. There’s (IMO) an interesting question around objects and functional programming, and I don’t know yet if any language has unified the two to my satisfaction. I have not been doing enough scholarship. I suspect the Grace model helps, but I really need to learn more.
Is subclassing/inheritance the same as invoking a closure? Is a closure “just” an object with a single method? Old questions...
- David
On Jun 25, 2016, at 3:17 AM, James Noble kjx@mcs.vuw.ac.nz [self-interest] self-interest@yahoogroups.com wrote:
So we have prototypes (self & JavaScript) and classes (sometimes added to JavaScript).
JavaScript prototypes are very different from Self prototypes.
Is there another way?
Yep. Object constructors from Emerald (like Javascripts' { } notation for objects) and concatenation rather than delegation or inheritance.
see e.g. http://lively.cs.tut.fi/publications/TR6-JavaScriptConcatenation-Taivalsaari... http://lively.cs.tut.fi/publications/TR6-JavaScriptConcatenation-Taivalsaari.pdf
or more generally http://www.cs.tut.fi/~taivalsa/publications.html http://www.cs.tut.fi/~taivalsa/publications.html
or more recently "Object Inheritance Without Classes" - Tim Jones et al http://homepages.ecs.vuw.ac.nz/~tim/publications/ecoop16-object-inheritance.... http://homepages.ecs.vuw.ac.nz/~tim/publications/ecoop16-object-inheritance.pdf
James
On Mon, Jun 27, 2016 at 6:57 AM, David Ungar ungar@me.com [self-interest] self-interest@yahoogroups.com wrote:
Is a closure “just” an object with a single method? Old questions...
This is how the Pony programming language treats closures. They are sugar for objects with an apply method:
http://tutorial.ponylang.org/expressions/object-literals.html
In practice it works quite well.
self-interest@lists.selflanguage.org