groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From OC <...@ocs.cz>
Subject Re: getAt inconsistence
Date Wed, 27 Jul 2016 11:27:04 GMT
Jochen,

On 25. 7. 2016, at 21:53, Jochen Theodorou <blackdrag@gmx.org> wrote:

> ... ... ... We have a method in DGM:
> 
>> public static Object getAt(Object self, String property) {
>>  return InvokerHelper.getProperty(self, property);
>> }
> 
> meaning Object itself provides a getAt method that uses getProperty - well, actually
it is equal to self.$property. Which of course means if you add a getAt(Object) method and
call this with a String or GString, we still call the above method. Which also explains your
problem ;)

Ah, I see. Looks like a pair

===
   mmc.getAt={ index ->
     ...
   }
   mmc.getAt={ String index ->
     ...
   }
===

does the job all right; thanks a big lot again!

All the best,
OC
Mime
View raw message