Include match.scm.
[bpt/guile.git] / ice-9 / receive.scm
1 ;;;; SRFI-8
2
3 ;;; Copyright (C) 2000 Free Software Foundation, Inc.
4 ;;;
5 ;;; This program is free software; you can redistribute it and/or
6 ;;; modify it under the terms of the GNU General Public License as
7 ;;; published by the Free Software Foundation; either version 2, or
8 ;;; (at your option) any later version.
9 ;;;
10 ;;; This program is distributed in the hope that it will be useful,
11 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ;;; General Public License for more details.
14 ;;;
15 ;;; You should have received a copy of the GNU General Public License
16 ;;; along with this software; see the file COPYING. If not, write to
17 ;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18 ;;; Boston, MA 02111-1307 USA
19
20 (define-module (ice-9 receive)
21 :export (receive)
22 :no-backtrace
23 )
24
25 (define receive
26 (procedure->memoizing-macro
27 (lambda (exp env)
28 `(call-with-values (lambda () ,(caddr exp))
29 (lambda ,(cadr exp) ,@(cdddr exp))))))