[gambit-list] How thread-mailbox-extract-without-rewind

Adrien Piérard pierarda at iro.umontreal.ca
Thu Oct 27 22:07:25 EDT 2011


Hi!

> So I need either a way to unread a message or to remove a message
> after I have peeked it. Right now I can not find any function which
> will do that.

Well, the point of peeking is *not* consuming!
What you can do is read the message, and then, send it back to you (to
"unread" it), or just discard it (to "remove" it).
Isn't it just what you want?
Something like:

(let ((message (thread-receive)))
  (if (need-to-unread? message)
    (thread-send (current-thread) message))) ;; back in da game \o/


P!

-- 
Français, English, 日本語, 한국어



More information about the Gambit-list mailing list