Oops, three replies. Is it ok if I only reply to one? :-)

On Tue, 18 Dec 2001, Dan Sugalski wrote:

> Hmmm. For the moment throw them into core.ops in a local copy. I'll work up 
> a protocol for adding ops files over the next day or so and document it.

Yeah, that'd be good. Putting them in core.ops works fine though, except
that I couldn't put any includes there. I just put it somewhere else, and
then it compiles. Good enough.

Having compiled and tested some example pasm now, it seems to work fine.

> >It's also possible that I need to use an external type or C++ class as
> >argument (read-only) for some of the ops, which I suppose means I need
> >to use PMCs. Is this possible yet?
> I'm not quite sure what you mean. The answer's probably [yes?], but do
> please explain more fully. :)

Actually, it may end up so that integers could be used just as well. But
as I'm not sure about this, consider the following scenario:

In the external file (the one with my functions), a C++ class is also
defined, called "Handle", which is used for object handles. One of the
functions is a simple string-based lookup called "om_find":

  Handle om_find (char *name) { ... }

The Parrot op is quite simple (except for the string conversion) :

AUTO_OP find(i, s|sc) {
  char *s = (char *) $2->bufstart;
  printf("Ok, let's find %s\n", s);
  $1 = OM_find(s);
}

Ok, let's say I want to use Handle PMCs instead of integer regs in the op
above. What do I do? Can I create a vtable that uses the Handle class?

Anyway, thanks for the help so far. :-)

Marcus
------------------------------------
 If you find that life spits on you
 calm down and pretend it's raining



Reply via email to