What is the correct contract for an on-tick handler in the universe teachpack?<br><br>I'm playing with the universe teachpack, and I'm having trouble writing an on-tick clause for a universe.<br><br>The help files says clearly:<br>
<br>(on-tick tick-expr) <br> tick-expr : (-> [listof world?] UniverseState bundle?)<br><br>The one example I could find of a universe with an on-tick handler (in universe.ss) says<br> <br> (universe '() <br> (on-new nu)<br>
(on-msg process)<br> #;<br> (on-tick (lambda (u x) (printf "hello!\n") (list u)) 1)))<br><br>This clearly supplies a function of 2 arguments, though not one that apparently matches the contract <br>
in the help file.<br><br>But when I try to say <br><br>(define (on-tick-fn worlds s-state)<br> (make-bundle worlds s-state empty))<br><br>(define (run-server d)<br> (universe<br> '*<br> (on-new on-new-fn)<br> (on-msg on-msg-fn)<br>
(on-tick on-tick-fn 1)<br> ))<br><br>I get:<br><br>> (run-server 1)<br>on-tick: procedure of one argument expected as first argument; given procedure of 2 arguments <br><br>What's up with this? What values are actually sent to the on-tick handler?<br>
<br>--Mitch<br><br><br><br><br><br>