From: Hal Fulton Date: 2006-07-17T10:32:20+09:00 Subject: Re: [QUIZ] Negative Sleep (#87) Mitchell Koch wrote: > * Ruby Quiz [060714 07:49]: > >>You could also view a sleep as specifying the relationship between >>the computations on either side of it. In that case, sleep(1) might >>request that the second computation begin at least a second after >>the completion of the first one. Negative sleeps would simply >>reverse the order of the two computations, sleep(-1) meaning that >>the first computation should begin at least a second after the >>completion of the second. > > > Alright, I basically took that definition of negative sleep, although > I had to decide what should happen when there are three or more > statements separated by negative sleeps and what should happen if a > negative sleep is before after everything else. I decided both > arbitrarily. > > I decided to implement it as a class that takes procs and runs them in > the right order, which I think came out pretty cleanly. [snip] This has to be the most useless Ruby Quiz I've ever seen. I like it a lot. Hal