Welcome to the CHICKEN Scheme pasting service

printf added to receive-message added by kiatoa on Sun Oct 21 22:25:02 2012

(define (receive-message socket #!key non-blocking (as 'string))
  (printf "receive-message START")
  (mutex-lock! (socket-mutex socket))
  (let* ((message (initialize-message (socket-message socket)))
         (result ((foreign-lambda int zmq_recv socket message int)
                  (socket-pointer socket)
                  message
                  (if non-blocking zmq/noblock 0))))
    (printf "receive-message POST let")

    (if (zero? result)
        (let ((data (message-data message as)))
          (printf "receive-message result=0")
          (mutex-unlock! (socket-mutex socket))
          (close-message message)
          data)
        (begin
          (printf "receive-message result!=0")
          (mutex-unlock! (socket-mutex socket))
          (close-message message)
          (if (memq (errno) '(again term))
              #f
              (zmq-error 'receive-message))))))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
What's the R5RS procedure to access the second element of a pair?
Visually impaired? Let me spell it for you (wav file) download WAV