On 19/11/2007, Ge Wang <ge@ccrma.stanford.edu> wrote:
This is bug, where the internal ID is uninitialized for user instantiated
Shred instances.  This has been fixed in CVS (unsporked shreds id default
to 0).


 One more thing, perhaps you already implemented this but in this code;
----------------------------

Shred foo;

spork ~ test() @=> foo;

second => now;

<<<foo.id()>>>;

foo.exit();

second => now;

<<<foo.id()>>>;


fun void test()
    {
    while(1) second => now;
    }
----------------------------

I'd like the second call for foo.id to return 0. This is useful if test() is a function that performs a specific task, then exits and we'd like to know if it already did so. IMHO (but perhaps others have better suggestions) this would be cleaner then defining a extra variable for this (especially as we may not know how many we need) and if 0 is the id for non-existant shreds this would also save making a .ifExists() (or similar) call.

Perhaps there are unforeseen downsides to this?


Keep on sporking,
Kas.