Hello,<br><br>I think it's not so much a question of 'what a shred is', as a more general issue of the scope of variables that are declared within a function (ie, they are not accessible outside the scope of said function). I'm about to leave my house, and not feeling quite clear enough to explain more completely, but I hope that's enough to point you in the right direction.
<br><br>Cheers,<br>Peter<br><br><div class="gmail_quote">On Nov 15, 2007 4:46 PM, Kassen <<a href="mailto:signal.automatique@gmail.com" target="_blank">signal.automatique@gmail.com
</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Dear list,<br><br>Shreds are objects (of type Shred) and functions aren't objects. This is all good and well but it gets harder when we spork a function and the function becomes a Shred and hence a Object. Consider this;
<br><br>------------------------<br>fun void tester()<br> {<br> "boom" => string beep;<br> while(1)<br> {<br> <<<beep>>>;<br> second => now;<br> }<br>
}<br> <br> <br>spork ~ tester() @=> Shred foo;<br>5::second => now;<br> <br>"clik" => foo.beep; //this doesn't work<br> <br>day=> now;<br>----------------------------------------
<br>
<br>It's not so clear to me *why* the offending line doesn't work. Maybe I'm misunderstanding something or making a syntax error but I think that what we are seeing here is a loss of namespace that would be useful and I don't understand why this happens.
<br><br>I also tried stuff along these lines;<br><br>----------------------<br>class Bar extends Shred<br> {<br> //stuff including variables and a constructor<br> }<br>------------------------------<br><br>If I do that I can instantiate a "Bar" but all it does is run it's constructor; I can't manage to spork a Bar or assign a sporked shred to a Bar. I can also make a array of Bar's but all that gets me is the constructor running;
<br><br>---------------------------<br>class Bar extends Shred<br> {<br> static int number;<br> <<<number++>>>;<br> }<br> <br>//print a series of numbers, no shreds in sight<br> Bar array[5];
<br>----------------------------------<br><br>So, now I'm quite happy I said so many times that there are no "stupid n00b questions" because now it's my turn to ask exactly what a "Shred" is because I'm starting to feel like I have no idea. :¬)
<br><br>Could somebody please explain to me exactly what's going on here?<br><br><br>Yours,<br>Kas.<br>
<br>_______________________________________________<br>chuck-users mailing list<br><a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank">chuck-users@lists.cs.princeton.edu</a><br><a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br><br></blockquote></div><br>