groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Theodorou <>
Subject Re: TypeChecked and with custom methods/parameters using ExpandoMetaClass
Date Sun, 12 Jun 2016 11:38:23 GMT
On 11.06.2016 21:59, chavan77 wrote:
> I solved it this way. I changed it to cache the type checked script and then
> clone it every time I need it. Question though about your suggestion, can I
> parse the script with typeChecked and then use the binding after when I want
> to run the parsed script? that way I dont need to add the base class. A
> follow up to that is, will these variables I bind be class level variables
> or global?

A variable in a script binding is only in that binding. Other scripts 
won´t see it, unless you decide to share the binding.

Can you use the binding in a type checked script? Not really. If you 
want to use the binding, you would have to use type checking extensions, 
that tell the compiler (a) where to find a vanilla variable, that is not 
found otherwise and (b) tell the compiler the type of the binding variable

bye Jochen

View raw message