5b4f1b81cbb27dc431512962974806c357fb5384
[bpt/guile.git] / module / language / r5rs / psyntax.boot
1 ;;; psyntax.ss -> psyntax.scm
2
3 ;; Copyright (C) 2001 Free Software Foundation, Inc.
4
5 ;; This program is free software; you can redistribute it and/or modify
6 ;; it under the terms of the GNU General Public License as published by
7 ;; the Free Software Foundation; either version 2, or (at your option)
8 ;; 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
13 ;; GNU General Public License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with this program; 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 ;;; Code:
21
22 (define sc-expand #f)
23 (define $sc-put-cte #f)
24 (define bound-identifier=? #f)
25 (define datum->syntax-object #f)
26 (define free-identifier=? #f)
27 (define generate-temporaries #f)
28 (define identifier? #f)
29 (define syntax-object->datum #f)
30 (define syntax-rules #f)
31 (define syntax-error #f)
32 (define $syntax-dispatch #f)
33
34 (define void (lambda () (if #f #f)))
35
36 (define andmap
37 (lambda (f first . rest)
38 (or (null? first)
39 (if (null? rest)
40 (let andmap ((first first))
41 (let ((x (car first)) (first (cdr first)))
42 (if (null? first)
43 (f x)
44 (and (f x) (andmap first)))))
45 (let andmap ((first first) (rest rest))
46 (let ((x (car first))
47 (xr (map car rest))
48 (first (cdr first))
49 (rest (map cdr rest)))
50 (if (null? first)
51 (apply f (cons x xr))
52 (and (apply f (cons x xr)) (andmap first rest)))))))))
53
54 (define ormap
55 (lambda (proc list1)
56 (and (not (null? list1))
57 (or (proc (car list1)) (ormap proc (cdr list1))))))
58
59 (define putprop set-symbol-property!)
60 (define getprop symbol-property)
61 (define remprop symbol-property-remove!)
62
63 (define core-eval eval)
64 (define (eval x) (core-eval (cadr x) (interaction-environment)))
65
66 (debug-set! stack 0)
67 (load "psyntax.pp")
68
69 (call-with-input-file "psyntax.ss"
70 (lambda (in)
71 (call-with-output-file "psyntax.scm"
72 (lambda (out)
73 (do ((obj (read in) (read in)))
74 ((eof-object? obj))
75 (write (sc-expand obj) out))))))