[plt-scheme] Re: Getting started embedding mzscheme in Windows/VS2008

From: jacmoe (jacmoe at mail.dk)
Date: Fri Feb 19 11:47:11 EST 2010

I am currently trying out a combination of mzscheme extension API and C
++ template metaprogramming, as described here:
https://trac.v2.nl/wiki/vge/MagickWrappers

Would be nice if there was an easier way, but blame that on C++.. ;)

Any pointers (pun intended?) appreciated, though.

On Feb 19, 3:55 pm, jacmoe <jac... at mail.dk> wrote:
> Thanks a lot for the example code. :)
> Even though it drove me mad trying to duplicate it.
>
> The problem is that the COM interface is using no vtable, and
> therefore it's possible to bind to member functions.
>
> I found some great code from the Fluxus project, however, which
> enabled me to embed and extend mzScheme (3m) succesfully. :)
>
> I have one question though:
>
> Is it possible to use scheme_make_prim_closure_w_arity to somehow get
> the class instance from the static callback function?
>
> And if it is, how do I use it?
> I could try casting prim to void* and then cast it to my object, but I
> am wondering if that's the right thing to do.
>
> I want to avoid using singletons/globals to access my class instances.
>
> Thanks in advance for any pointers.
>
> On Feb 14, 2:00 am, jacmoe <jac... at mail.dk> wrote:
>
> > Thanks a lot! :)
> > Just what I need.
>
> > On Feb 14, 1:38 am, Thomas Chust <ch... at web.de> wrote:
>
> > > jacmoe wrote:
> > > > [...]
> > > > Is there any other small example of embedding mzscheme in C++ ?
> > > > [...]
>
> > > Hello,
>
> > > some time ago I played around with embedding PLT Scheme as a Mozilla
> > > XPCOM component. The C++ source is here:
>
> > >  https://code.launchpad.net/~chust/+junk/MzXPCOM
>
> > > The code should be functional and it used to compile with both the
> > > conservative and the precise garbage collection runtimes. Maybe there's
> > > something useful for you inside :-)
>
> > > Ciao,
> > > Thomas
>
> > > --
> > > When C++ is your hammer, every problem looks like your thumb.
> > > _________________________________________________
> > >   For list-related administrative tasks:
> > >  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> > _________________________________________________
> >   For list-related administrative tasks:
> >  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> _________________________________________________
>   For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme


Posted on the users mailing list.