Togos wrote:
> 
> --- Sean O'Rourke <[EMAIL PROTECTED]> wrote:
> > Luke Palmer <[EMAIL PROTECTED]>
> > writes:
> >
> > > How does one call a parrot Sub from
> > > C and get the
> >
> > I'd vote for stuffing args into the
> > interpreter, calling the sub's invoke()
> > method, then digging through the registers
> > to pull out the return values (see e.g.
> > Parrot_pop_argv in method_util.c, which
> > may be outdated). Then again, it would be
> > _your_ pain, not mine ;).
> 
> The Parrot-C interface could simply come with
> some wrapper functions that would do this for
> you. I suppose this could be done with a couple
> printf/scanf-like functions, except they would
> work with pcc parameters instead of strings.

Would that be a printf-like to put args onto the stack, with the format
string being the subroutine's prototype, and a scanf-like to get return
values from the stack, with the format string being the return context?

If we didn't have NCI, using these two functions in the other order (to
get the arguments passed in, then to return values) might be useful for
functions which want to be called from Parrot.

Hmm... even with the existance of NCI, doing that might be useful --
having a function process it's arguments itself, rather than having NCI
do it, might be more efficient.

Oh, and maybe this idea could probably replace "pxs.c"?

> (This would probably tie in to the subroutine
> signatures discussed in 'calling conventions,
> variable-length parameter lists'.)

-- 
$a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca
);{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "[EMAIL PROTECTED]
]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}

Reply via email to