[Vm-dev] How to addGCRoot: ? help requested

David T. Lewis lewis at mail.msen.com
Mon Dec 24 00:40:52 UTC 2012


On Mon, Dec 24, 2012 at 01:12:07AM +0100, Igor Stasenko wrote:
>  
> On 24 December 2012 00:28, David T. Lewis <lewis at mail.msen.com> wrote:
> >
> > On Mon, Dec 24, 2012 at 12:05:46AM +0100, Nicolas Cellier wrote:
> >>
> >> 2012/12/23 Igor Stasenko <siguctua at gmail.com>:
> >> >
> >> > On 23 December 2012 22:25, Nicolas Cellier
> >> > <nicolas.cellier.aka.nice at gmail.com> wrote:
> >> >>
> >> >> Ah OK, thanks, I get it...
> >> >> Two questions remain:
> >> >>
> >> >> 1) how to access addGCroot: from within a SmartSyntaxInterpreterPlugin ?
> >> >
> >> > interpreterProxy addGCroot: ...
> >> >
> >>
> >> Hmm, in NB you used a different strategy...
> >> First, you defined a NBInterpreterProxy to perform a simpleCall to
> >> addGCRoot() after registering this function in class method
> >> #proxyFunctionsData unless it is from #CogProxyFunctionsData (why
> >> two?)
> >> Then, no plugin calls addGCRoot: directly.
> >> Instead you defined a primAddGCRoot: in order to use it from within the image.
> >> That's a bit too much for a helpful simple example.
> >>
> >> I fail to see how this easily transpose to a vanilla VMMaker and it's
> >> native InterpreterProxy.
> >> I think I'll have to hack InterpreterProxy to give access to
> >> addGCRoot: unless there is more magic I missed in the code
> >> generator...
> >
> > It is already defined in the InterpreterProxy, so in principle
> > 'interpreterProxy addGCroot: ... ' should work from a plugin. However,
> > I do not see any actual examples of this being used in any plugins
> > in my image. I have a hard time figuring out how to use something
> > like this without a working example, so maybe someone can provide a
> > pointer to a plugin that is currently using this mechanism?
> >
> > Dave
> >
> 
> Here example for you guys.
> 

Thank you :)

Dave

> -- 
> Best regards,
> Igor Stasenko.




More information about the Vm-dev mailing list