[chuck-users] Two loops?

Tom Lieber tom at alltom.com
Mon Apr 30 14:30:11 EDT 2012


On Mon, Apr 30, 2012 at 2:27 PM, Timothy Leonido
<timothy.leonido at gmail.com> wrote:
> Is there any way for the two loops below to run simultaneously from the same
> shred?

There's no way to do what you're asking. Why is it that you need them
to be in the same shred? If you actually just mean that they need to
be in the same file, then you can do something like this:

  fun void loop1() {
      while(…) {
          …

      }
  }

  fun void loop2() {
      while(…) {
          …

      }
  }

  spork ~ loop1();
  spork ~ loop2();

-- 
Tom Lieber
http://AllTom.com/
http://infinite-sketchpad.com/


More information about the chuck-users mailing list