Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 1.6-beta-1
-
Fix Version/s: 1.6-beta-2, 1.6-rc-1, 1.6-rc-2
-
Component/s: syntax
-
Labels:None
-
Number of attachments :
Description
The current implementation of mixin requires the target type to be the first argument:
IntegerMixin {
Integer crazyPlus(Integer self, Integer other) { self - other }
}
This is ugly. We need to change it to support true mixins where we change the meaning of "this" to refer to the object:
IntegerMixin {
Integer crazyPlus(Integer other) { this - other }
}
You should also be allowed to store state in the IntegerMixin class so that mixins can be stateful
With the @Category stuff, I think Alex fixed this, if I'm not mistaken.
I'm closing the issue, but please reopen if I missed the point here.