summaryrefslogtreecommitdiff
path: root/csys/dump-macros.scm
blob: 404adf88af3cc3c168004d50bcdb82396b52afc1 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
(define-syntax (set-strictness-vars)
  (let ((res '()))
    (dotimes (i *pre-defined-strictness-vars*)
       (push `(setf (dynamic ,(vector-ref *pre-defined-strictness-names* i))
		    (vector-ref *pre-defined-strictness-table* ',i))
	     res))
    `(begin ,@res)))

(define-syntax (setup-gtyvar-vars)
 (let ((res '()))
   (dotimes (i *num-saved-gtyvars*)
     (push `(setf (dynamic ,(vector-ref *saved-gtyvar-varnames* i))
		  (vector-ref *saved-gtyvars* ',i))
	   res))
   `(begin ,@res)))

(define-syntax (assq/insert x table)
  `(let ((res (assq ,x ,table)))
     (if (eqv? res '#f)
	 (begin
	   (let ((new-pair (cons ,x '#f)))
	     (push new-pair ,table)
	     new-pair))
	 res)))

(define-syntax (assq/insert-l x table)
  `(let ((res (assq ,x ,table)))
     (if (eqv? res '#f)
	 (begin
	   (let ((new-pair (cons ,x '())))
	     (push new-pair ,table)
	     new-pair))
	 res)))