<br><br><div><span class="gmail_quote">On 10/5/06, <b class="gmail_sendername">vb</b> &lt;<a href="mailto:vboehm@gmx.ch">vboehm@gmx.ch</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
hi all,<br>i'm still struggling with the basics of chuck, it seems.</blockquote><div><br><br>Hi there! No problem, let's have a look at it.<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
is it more appropriate for chuck's liking to advance time inside the<br>impulse function and spork it only once,<br>or to spork the impulse function regularly?<br>volker.</blockquote><div><br><br>Well, both could be used and either might be apropriate depending on the situation. I didn't try actually running either example but both look fine to me. I'd say that for just this simple thing example 1 would be best because it's most simple and probably cheaper on the cpu. 
<br></div><br><br>The second form could also be more simple since it's not actually nesicary for two shreds to run at the same time you could simply call &quot;click()&quot; as a function instead of sporking it to it's own shred.
<br><br>Generally sporking shreds is used to have several things happen at the same time. Function calls without sporking (instead of copying the function's code to one or more locations) is mainly usefull for clarity, readability and keeping your files from growing realy big. If neither is needed I would't use either because they add complexity. Here I'd use;
<br><br>-------<br>Impulse i =&gt; dac;<br><br>while(true)<br>&nbsp;&nbsp; {<br>&nbsp;&nbsp; 1.0 =&gt; i.next;<br>&nbsp;&nbsp; 0.5::second =&gt; now;<br>&nbsp;&nbsp; }<br>---------<br><br>This is the most simple form; if no more is needed then I wouldn't do any more.
<br><br>I think you are doing well; clearly you figured out that you can have several programs that do the same thing, the one thing I could add to it is that when you have several functionally identical programs you can pick the one you like best. In those cases I myself often pick the one I find most simple to deal with unless one of them is much less heavy on the cpu. I think you'll find that the larger you programs become the more both matter; a very big program needs good structuring or you'll be lost in it next week and clearly for larger programs it's important to make sure the cpu doesn't get overworked. Of cource it's also possible to have a small program that looks simple but that still takes a lot of cpu but even then you'll benefit from keeping it all simple because then it's easier to find what bit costs so much cpu.
<br><br>I hope this covers at least some of your question?<br>Do give a shout if I missed something.<br><br>Yours,<br>Kas.<br></div>