[chuck-users] Return values of sporked functions?

Peter Todd chuck at xinaesthetic.net
Sat Jun 7 08:04:54 EDT 2008


Hi all,

>
> Couldn't find this one in the manual.  Where do sporked funcitons
>> return to?  How do I get the return value of a spoked function?
>>
>
> they don't and you won't, I fear..... (or shred-heaven, depending on your
> persuasion)
>

Shred-heaven would have been my assumption, but it doesn't appear to be the
case, and it does make a difference..... at the moment, it appears that if
you run

// <chuck>
int addThree(int i){
    <<< "adding three..." >>>;
    return i + 3;
}

<<< "about to spork..." >>>;
spork ~ addThree(2);
<<< "sporked" >>>;
// </chuck>

then you get neither an error, nor the message "adding three..."; but you do
get the other two messages.  So, say the main purpose of the function was to
do a load of other stuff, and the return value was just there for
conveniance, or to return any error code perhaps (and you didn't expect to
be able to read it in the context of sporking the function)... you get some
rather unexpected behaviour, it seems to me.

Regards,
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20080607/9d9deb2d/attachment.html>


More information about the chuck-users mailing list