3 ms·
The E programming language, and its newer relatives like Monte, lack classes; instead, objects are defined by object literals and the extends keyword performs o
by BuuQu9hu 10y ago
The E programming language, and its newer relatives like Monte, lack classes; instead, objects are defined by object literals and the extends keyword performs object composition by delegation.
- goatlover 10y agoYou mean it's prototypal, like Self, IO, Javascript?
- abecedarius 10y agoNo, it's similar to creating an object this way in ES6: function makeVector(x, y) { return { norm: () => Math.sqrt(x*x + y*y), // ... more methods ... }; } but frozen so that consumers can't change it except by calling a method. It's odd how this is the 'obvious' way to generalize lambda expressions from functions to objects, yet it's rare to see this style, and you always have to clarify that you're not talking about prototypes. (IIRC Emerald, mentioned in the paper, also works something like this.)