satyr/coco

`implements`

satyr opened this issue · 3 comments

class C implements D, E
  ...

would roughly be equal to:

class C
  prototype <<<< D
            <<<< E
  ...

<<<< over <<< for flattening.

Might lead people to expect interfaces. How about a Scala-like class C extends D with E?

Might lead people to expect interfaces.

Interfaces as in Java don't make much sense without static typing though. I think implements for mixins/traits works since the goal--providing additional sets of behaviors--is the same. It's already reserved, so we can make use of it with no drawbacks.

How about a Scala-like class C extends D with E?

Wouldn't parse because:

$ coco -bce 'D with E then'
D((function(){}.call(E)));

is already valid.

Really interesting