[racket] Trouble with nack-guard-evt

From: Tobias Hammer (tobias.hammer at dlr.de)
Date: Thu Mar 28 11:08:09 EDT 2013


i am trying to understand how nack-guard-evt works. Therefore i created  
the appended test program. Sometimes it stops with the error message and  
sometimes it prints the three values. It is clear to me what the error  
means and why it is raised.
What i am not understanding is, why the nack generator is not run every  
time sync is called. I would have expected from the docs that it is run on  
every sync.
Can someone clarify why my assumptions are wrong and how nack-guard-evt is  
expected to behave?

Related question: The docs for the function talk abound 'proc', should it  
be 'generator'?


;; -----------------------------

#lang racket

(define nack #f)

(sync (handle-evt
        (lambda (_) 'ALWAYS))
        (lambda (e)
          (set! nack e)

(printf "~a\n" (sync/timeout 0. nack))

. . sync/timeout: contract violation
   expected: evt?
   given: #f
   argument position: 2nd
   other arguments...:



Tobias Hammer
DLR / Robotics and Mechatronics Center (RMC)
Muenchner Str. 20, D-82234 Wessling
Tel.: 08153/28-1487
Mail: tobias.hammer at dlr.de

Posted on the users mailing list.