Axel Rauschmayer wrote:
Nice! Should the operator (case) definitions really be inside the
class? E.g., conceptually, number + point2d does not belong to a
single class, it belongs to both.
Or to neither. Still there's an advantage in using the class as the
locus of multimethod definitions: all combinations point2d defines with
other types, in particular with number, go in value class point2d.
Another advantage: unary operators do belong here.
Or, possibly:
```
function + (a :: number, b :: point2d) {
return point2d(a + b.x, a + b.y);
}
```
Nope, guard syntax is losing to bind, and we don't want guards here anyway.
/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss