Claude Pache (2015-02-23T21:51:46.000Z)
> Le 23 févr. 2015 à 21:47, Allen Wirfs-Brock <allen at wirfs-brock.com> a écrit :
> 
> Here is a new proposal for a declarative replacement for Function.prototype.toMethod which was dropped from ES6 earlier this year
> https://github.com/allenwb/ESideas/blob/master/dcltomethod.md <https://github.com/allenwb/ESideas/blob/master/dcltomethod.md> 
> 
> I've added this to the agenda for next months TC39 meeting but pre-meeting discussion is welcomed right here.
> 
> Allen
> 

Interestingly, two days ago I've imagined the same solution, except I was using `.=` instead of `mixin`. The `.=` syntax is reminiscent to assignment operators like `+=` (but, of course, it's not an operator, since its right hand side is not a standalone expression). Reusing your examples:

```javascript
export const someMixin = obj => obj .= {
   method1() {return super.method1()},
   Method2() {...},
   data: 42
};
```

and, for classes (but with mandatory `class`-keyword):

```javascript
C .= class {
  m2() {super.m2()}
}
```

—Claude
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150223/79b876f8/attachment.html>
d at domenic.me (2015-03-06T00:42:33.741Z)
Interestingly, two days ago I've imagined the same solution, except I was using `.=` instead of `mixin`. The `.=` syntax is reminiscent to assignment operators like `+=` (but, of course, it's not an operator, since its right hand side is not a standalone expression). Reusing your examples:

```javascript
export const someMixin = obj => obj .= {
   method1() {return super.method1()},
   Method2() {...},
   data: 42
};
```

and, for classes (but with mandatory `class`-keyword):

```javascript
C .= class {
  m2() {super.m2()}
}
```