On Wed, Mar 11, 2009 at 12:07 AM, John Rose <john.r...@sun.com> wrote:
> > On Mar 10, 2009, at 3:07 PM, Jochen Theodorou wrote: > > > What if an object comes from Java land into Groovy land and such a > > check > > has happened already? > > The injected interface would be defined and controlled by Groovy and > probably should be package-private. > > Even if it were public, so that random code could grab it and say "foo > instanceof GroovyInject", the first time it happens for foo's class > Foo, Groovy would be asked to fill in the GroovyInject methods on > Foo. Basically, that would be Foo's entry into Groovy-land. > > (If for some reason this is too early, and it is a violation of some > usage rule, then Groovy could defer the question by throwing an error > of some sort; that would of course terminate the instanceof bytecode > abnormally.) Is this a behavior we want? As the prototype is currently implemented it swallows the exception and marks the injection as failed. I think that a generic exception is probably a failed injection that should not be re-attempted. But we could introduce a specific DelayInjectionException (or something like that) for this if we want to introduce this feature. > > > After GroovyInject is injected, its getGroovyMeta method would > (presumably) return a constant customized Groovy metaclass tailored to > Foo. > > -- John > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "JVM Languages" group. To post to this group, send email to jvm-languages@googlegroups.com To unsubscribe from this group, send email to jvm-languages+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jvm-languages?hl=en -~----------~----~----~----~------~----~------~--~---