~nilium/hardwood

af0de71d77d53415f2ab76ba30e36170a1564ffc — Evan Hanson 6 years ago 8c622d1
Make the "after" clause in (recv ...) support a body
2 files changed, 3 insertions(+), 3 deletions(-)

M hardwood-impl.scm
M hardwood.wiki
M hardwood-impl.scm => hardwood-impl.scm +2 -2
@@ 161,7 161,7 @@
      (let* ((clauses (cdr expr))
             (timeout-clause (alist-ref 'after clauses compare))
             (timeout (and timeout-clause (car timeout-clause)))
             (timeout-proc (and timeout-clause (cadr timeout-clause)))
             (timeout-body (if timeout-clause (cdr timeout-clause) '(#f)))
             (clauses (alist-delete 'after clauses compare)))
        `(rcv-msg (lambda (m)
                    (##core#app


@@ 171,7 171,7 @@
                                           (receive (match m
                                                           ,@clauses)))))))
                  ,timeout
                  (lambda () ,timeout-proc))))))
                  (lambda () ,@timeout-body))))))

(define (!? pid msg #!optional (timeout #f) (default no-default))
  (let ((tag (make-tag)))

M hardwood.wiki => hardwood.wiki +1 -1
@@ 178,7 178,7 @@ returns {{reply}}.

==== recv

<syntax>(recv PAT [...] [(after TIMEOUT TMO-ACTION)])</syntax>
<syntax>(recv PAT [...] [(after TIMEOUT TMO-ACTION ...)])</syntax>

Match incoming messages against {{PAT ...}}.