jastrachan | 10 Jan 09:00 2005
Picon

Re: [groovy-dev] RFE javadoc like reflection syntax

On 9 Jan 2005, at 17:19, John Wilson wrote:
> On 8 Jan 2005, at 21:40, Jochen Theodorou wrote:
>
>> I just filled http://jira.codehaus.org/browse/GROOVY-697
>>
>> i'm looking forward to discuss this feature, because I think we could 
>> use this to fix some issues
>>
>
> I don't quite see why you would want this in Groovy. I can see the 
> point in Java, but groovy has duck typing. This pretty much removes 
> all the common needs for explicit use of reflection.
>
> If I want to call the method bar which takes a string on the object 
> foo I just do:
>
> def foo = ....
> foo.bar("some string")
>
> Do you have a use case where duck typing doesn't do what you want?

Agreed. And we're pondering about adding a mechanism to explicitly 
refer to a field (assuming you've access rights to it) via

foo. <at> bar

So I'm still unclear as to the use case given that we have dynamic 
method dispatch whenever you need it.

James
-------
http://radio.weblogs.com/0112098/


Gmane