groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From C├ędric Champeau <cedric.champ...@gmail.com>
Subject Re: GroovyShell Binding with TypeChecked
Date Thu, 04 Feb 2016 14:58:22 GMT
There *is* such an example: take a look at how the markup template engine
is implemented. It also uses a binding, and provides type information
through type checking extensions. It's not the simplest example ever,
though.

2016-02-04 14:29 GMT+01:00 Jochen Theodorou <blackdrag@gmx.org>:

>
>
> On 04.02.2016 11:18, Anton Sarov wrote:
> [...]
>
>> 2) I try to compile "A" and provide some binding to the
>> GroovyShell/GroovyClassLoader/etc. - I would expect that the binding
>> "takes the role" of the type checker extension. So that the compiler
>> would say "Oh, look, there is a variable whose type I do not know, but I
>> have it here in the binding, so I will use this one".
>>
>> I still do not get why this is not feasible. And that was my question in
>> the previous post - is it so, that the compiler ignores the binding.
>> Should I think of the binding as something only "runtime-like".
>>
>
> the compiler has no idea about what is in the binding. In other words,
> that link is missing. As of how to provide that link... no idea actually.
> The architecture isolates the compiler quite a lot from all kinds of
> runtime data like a binding normally. Even with extensions, you normally do
> not target actual runtime data, but an abstraction of that provided in a
> way known to the extension.
>
> bye Jochen
>

Mime
View raw message