Commit | Line | Data |
---|---|---|
ce543a9f JG |
1 | ;;; syntax-case.scm --- R6RS support for `syntax-case' macros |
2 | ||
3 | ;; Copyright (C) 2010 Free Software Foundation, Inc. | |
4 | ;; | |
5 | ;; This library is free software; you can redistribute it and/or | |
6 | ;; modify it under the terms of the GNU Lesser General Public | |
7 | ;; License as published by the Free Software Foundation; either | |
8 | ;; version 3 of the License, or (at your option) any later version. | |
9 | ;; | |
10 | ;; This library 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 | ;; Lesser General Public License for more details. | |
14 | ;; | |
15 | ;; You should have received a copy of the GNU Lesser General Public | |
16 | ;; License along with this library; if not, write to the Free Software | |
17 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
18 | \f | |
19 | ||
20 | (library (rnrs syntax-case (6)) | |
21 | (export make-variable-transformer | |
22 | syntax-case | |
23 | syntax | |
24 | ||
25 | identifier? | |
26 | bound-identifier=? | |
27 | free-identifier=? | |
28 | ||
29 | syntax->datum | |
30 | datum->syntax | |
31 | generate-temporaries | |
32 | with-syntax | |
33 | ||
34 | quasisyntax | |
35 | unsyntax | |
36 | unsyntax-splicing | |
37 | ||
38 | syntax-violation) | |
7bcbdce1 GW |
39 | (import (only (guile) make-variable-transformer |
40 | syntax-case | |
ce543a9f JG |
41 | syntax |
42 | ||
43 | identifier? | |
44 | bound-identifier=? | |
45 | free-identifier=? | |
46 | ||
47 | syntax->datum | |
48 | datum->syntax | |
49 | generate-temporaries | |
50 | with-syntax | |
51 | ||
52 | quasisyntax | |
53 | unsyntax | |
0c7398a7 JG |
54 | unsyntax-splicing) |
55 | (ice-9 optargs) | |
56 | (rnrs base (6)) | |
57 | (rnrs conditions (6)) | |
58 | (rnrs exceptions (6)) | |
59 | (rnrs records procedural (6))) | |
ce543a9f | 60 | |
0c7398a7 JG |
61 | (define* (syntax-violation who message form #:optional subform) |
62 | (let* ((conditions (list (make-message-condition message) | |
63 | (make-syntax-violation form subform))) | |
64 | (conditions (if who | |
65 | (cons (make-who-condition who) conditions) | |
66 | conditions))) | |
67 | (raise (apply condition conditions)))) | |
68 | ) |