[chuck-users] Return values of sporked functions?

mike clemow gelfmuse at gmail.com
Fri Jun 6 04:39:28 EDT 2008

Yeah, that's what I figured.  It's okay, it was actually a dumb idea
anyway.  I'm creating micro-structures of wavelet grains by sporking a
function that sequences the sporking of functions that run the
wavelets.  Both functions need to advance time and must be sporked (so
they can be simultaneous).  i wanted them to return a duration equal
to the length that they ran.  But if i do my job right i will either
a) know ahead of time or, b) not care.



On Fri, Jun 6, 2008 at 2:34 AM, Kassen <signal.automatique at gmail.com> wrote:
> 2008/6/6 mike clemow <gelfmuse at gmail.com>:
>> Hello list,
> Hey, mike!
>> 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)
> Normal functions run inside of a shred and can return a value for the rest
> of the shred to work with. Sporked functions, on the other hand, run paralel
> to the sporking shred, in their own shred. As the originating shred doesn't
> wait for them to finish it makes no sense for them to return anything.
> Because of this you can only spork functions of return-type "void".
> You can still, BTW, advance time within a normal function if you'd like. On
> the other hand; you don't need to advance time in sporked functions as such,
> it's just that sporking only makes sense if you also advance time in that
> function/shred.
> Because of this I'm not really sure what you need return values from sporked
> functions for but if your sporked functions need to comunicate to the other
> shreds on what they've done events may suit your needs?
> Hope that clarifies.
> Yours,
> Kas.
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users


More information about the chuck-users mailing list