Complete Minimal Classes

Tab Atkins Jr. jackalmage at gmail.com
Fri Apr 6 13:31:21 PDT 2012


On Fri, Apr 6, 2012 at 1:27 PM, Kevin Smith <khs4473 at gmail.com> wrote:
> Looking at Allen's collection classes, it's clear that our maximally minimal
> classes aren't sufficient for describing a large subset of the classes we
> might want to create.  As a general goal, I think that a complete class
> syntax should be able to express all of the external interface of the class,
> for all except a small set of edge cases.

A complete class syntax, yes.  Maximally-minimal classes aren't
attempting to be a complete class syntax.  They're trying to be a
maximally minimal class syntax, which is friendly to future extension
to make it more complete.  That way we can defer the debates about
future functionality and syntax while still getting some work done
now.

>  I believe the following features
> are missing:
>
> 1) A way to add methods to the constructor.
> 2) A way to add arbitrary properties to the constructor.
> 3) A way to add arbitrary properties to the prototype.
>
> I'd also like to add a fourth feature:
>
> 4) The ability to separately define the [[Call]] and [[Construct]] behavior
> of the constructor.
>
> I've created a couple of gists with a variant of our minimal classes which
> is intended to provide these features:
>
> https://gist.github.com/2319957
> https://gist.github.com/2322512
>
> I've used "static" as a keyword.  I know it's a misnomer - but it's not too
> bad as misnomers go.  I've also left out private members and private names,
> as IMO they are an orthogonal concern.
>
> Let me know what you think - and thanks for your time everyone!

I think all of this functionality is useful, but not strictly
necessary right now, and we can add it in the future.

~TJ


More information about the es-discuss mailing list