Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #34452] [TODO] Add return signature to Parrot_call_sub that returns multiple values

5 views
Skip to first unread message

Matt Diephouse

unread,
Mar 16, 2005, 9:50:15 AM3/16/05
to bugs-bi...@rt.perl.org
# New Ticket Created by Matt Diephouse
# Please include the string: [perl #34452]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=34452 >


This TODO item is from an email from Leo, reproduced below with some
context.

Message-ID: <200503150803...@thu8.leo.home>

--------Original Message--------
William Coleda <wi...@coleda.com> wrote:
> Given the perldoc for src/extend.c,
>
>       "void* Parrot_call_sub(Parrot_INTERP interpreter, Parrot_PMC
sub, const
>       char *signature, ...)"
>           Call a parrot subroutine the given function signature. The
first
>           char in "signature" denotes the return value. Next chars
are argu-
>           ments.
>
>           The return value of this function can be void or a pointer
type.
>
> If only the first character is the return value, how does one deal
> with subroutines that return  multiple values?

Well, you can't access multiple return values from within the C
function, where you are calling the PIR code. OTOH, if the PIR code did
return more values, we should get them back to the caller.

We should probably have a new return signature for this, e.g.

 "@" - collect all return values, stuff them into an array and return
 that.

OTOH you could use Parrot_runops_fromc() and pick up return values from
the returned frame pointer C<bp>.

leo

0 new messages