[gambit-list] example from the doc

Mikael mikael.rcv at gmail.com
Mon May 12 08:33:44 EDT 2014


Denis, the unique variable is for it to work even if the thread ended its
execution by returning a symbol by the name unique - it interprets fine,
what's your err?


2014-05-12 2:38 GMT+02:00 Denis Fourt <denis.prog at hotmail.com>:

> Hi,
>
> In Gambit 4.7.2 documentation, in the section dedicated to threads, there
> is the following code example :
>
>   (define thread-alive?
>             (let ((unique (list 'unique)))
>
>               (lambda (thread)
>                 ; Note: this procedure raises an exception if
>                 ; the thread terminated abnormally.
>                 (eq? (thread-join! thread 0 unique) unique))))
>
> This code is actually incorrect (according to gsi), the let is rejected. I believe that :
>
> (define thread-alive?
>
>  (lambda (thread)
>
>      (eq? (thread-join! thread 0 'unique) 'unique)))
>
>
> should be enough (though I do not know what happens if the thread returns nothing). I would like to know if there was some precise reason behind this let construction.
>
> Thanks,
>
>
> Denis
>
>
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20140512/72aa1fbf/attachment.htm>


More information about the Gambit-list mailing list