Hacker News new | ask | show | jobs
by BuuQu9hu 3452 days 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.
1 comments

You mean it's prototypal, like Self, IO, Javascript?
No, 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.)