>
> While you wouldn't use A because it can't express the full semantics of C,
> that doesn't mean that many users who currently have to write B wouldn't
> prefer to be able to write A.
>

Yes - many (most?) users will benefit from being able to write A.  But the
thrust of my argument is not that there is a net loss to users, but that
there's a subtle shift in flexibility going on.  See below.


> I don't believe that simply allowing a non-literal value as the RHS of <|
> would be an adequate solution to your problem (or at least to all similar
> problems)


For the general case, I agree.  I've abandoned this line of thought.


> As an alternative you suggest that declarative class syntax would make
> your library unnecessary.  However, I assume that the same caveat applies
> for that syntax as you are  applying to the object literal pattern.  You
> would only use the declarative syntax if it supported the full class
> semantics you have chosen to use for your library.
>

No.  I'll be more than happy to use any sane *declarative* class syntax,
even without mixins or other features.

I think the following analogy will help explain my position:

Imagine the underlying facilities for class-like abstraction are the engine
of a car, and the programming interface for utilizing those abstractions
are the body.

ES3 gave us a pretty decent engine, housed inside of a real clunker.  But
ES3 was flexible, so it gave me the tools to create a shiny new body and to
move the engine into that body.

ES6 (so far) gives us an even better engine, and this time it's housed in a
slightly better-looking body.  It's not dented and rusty, but it ain't no
hot rod either.  But this time around, I'm not able to move that engine
into my own custom body - not without giving up a bunch of new features.

The more I think about the problem, the more sure I am of the solution:  a
proper class syntax, and removing the special case of <| where the RHS is a
function.

kevin
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to