History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GROOVY-2818
Type: Bug Bug
Status: Open Open
Priority: Blocker Blocker
Assignee: Alex Tkachman
Reporter: Graeme Rocher
Votes: 3
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
groovy

Either support true stateful mixins or remove the current experimental implementation all together

Created: 11/May/08 03:11 AM   Updated: 11/May/08 03:11 AM
Component/s: syntax
Affects Version/s: 1.6-beta-1
Fix Version/s: 1.6, 1.6-rc-1, 1.6-beta-2

Time Tracking:
Not Specified


 Description  « Hide
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



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.