Guile Mailing List Archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: receive

receive is just a convenience for gluing a values-producer and consumer
together, saving the typing of a couple lambda's. There is an
implementation in terms of call-with-values in guile-scsh (file
receive.scm). Here it is:

; Copyright (c) 1993, 1994 Richard Kelsey and Jonathan Rees.  See file COPYING.

(define-syntax receive
  (syntax-rules ()
    ((receive ?vars ?producer . ?body)
     (call-with-values (lambda () ?producer)
       (lambda ?vars . ?body)))))

Guile Home | Main Index | Thread Index