Hi Folks,

I've always done this:

now + 10::second => time later;

while (now < later) {
// do stuff...
}

since, "time < time" resolves to either true or false, then the while() construct will work.

Mike

On Fri, Sep 24, 2010 at 1:57 PM, Tom Lieber <tom@alltom.com> wrote:
On Fri, Sep 24, 2010 at 8:37 AM, Andrew C. Smith
<andrewchristophersmith@gmail.com> wrote:
> Yeah, I guess one thing we didn't really mention is that the argument
> has to be a true/false value. until(5::second) won't work because
> 5::second will not evaluate to true nor false. I think that's the main
> misconception.

Is that true? This works how I'd think it should:

 until(5::second) {
   <<< "won't happen" >>>;
 }

 do {
   <<< "hi" >>>;
   second => now;
 } until(5::second);

 while(5::second) {
   <<< "bye" >>>;
   second => now;
 }

--
Tom Lieber
http://AllTom.com/
http://favmusic.net/
_______________________________________________
chuck-users mailing list
chuck-users@lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users



--
http://michaelclemow.com
http://semiotech.org