|
Re: Extension as first class construct: msg#00118lang.groovy.user
This is not like use as far as I can tell from the wiki. In Objective-C you can define an extension to a class (called a Category) that adds methods to the class. Any instance of the class or a subclass will have the added methods. @interface baseClass (category) is how you declare it in Objective-C. I have used this for example to add methods for serializing primitive values more directly than is supported by the NSCoder interface. In Java it would also be useful to be able to append an interface to an existing class that implements the required methods (via extension possibly). This would allow making classes serializable that are not so by default. Since Groovy would not really be adding the methods to the class it would be good to support adding methods to all instances that implement an interface. I could live with it being an executable statement, but it could also be a declaration that looks like a class. Michael On Oct 15, 2004, at 3:00 PM, Jeremy Rayner wrote: On Thu, Oct 14, 2004 at 08:16:48PM -0700, Michael Latta wrote:
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Variable defined, Jeremy Rayner |
|---|---|
| Next by Date: | Re: Did anyone post a response to "the optional features considered sucky" article, John Rose |
| Previous by Thread: | Re: Extension as first class construct, Jeremy Rayner |
| Next by Thread: | Variable defined, juhani |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |