File: theme-d-binder.scm

package info (click to toggle)
theme-d 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 12,784 kB
  • sloc: lisp: 47,684; sh: 4,200; makefile: 455; ansic: 319
file content (51 lines) | stat: -rw-r--r-- 1,025 bytes parent folder | download
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
;; Copyright (C) 2008-2013 Tommi Höynälänmaa
;; Distributed under GNU General Public License version 3,
;; see file doc/GPL-3.



;; *** Binder object ***


(import (rnrs exceptions)
	(srfi srfi-1)
	(th-scheme-utilities stdutils)
	(th-scheme-utilities hrecord))


(define-hrecord-type <binder> ()
  param-cache
  allocate-variable
  type-check?
  optimize-copying?
  preserve-types?
  instantiation?
  make-instances?
  accept-incomplete?
  ;; The following field can be removed.
  fixing?
  fixed-tvars
  ht-globals-by-address
  ht-method-decls
  decl-proc-instances
  visited-in-binding
  current-repr-to-bind
  tcomp-inside-param-proc?
  inside-param-proc?
  marker-table
  l-overwrite
  s-cur-toplevel
  expr-cur-proc
  optimize-raw-proc-inst?
  ht-raw-procs)


(define is-binder? (get-hrecord-type-predicate <binder>))


(define (binder-set-cycle! binder repr)
  (hashq-set! (hfield-ref binder 'ht-all-cycles) repr #t))


(define (binder-has-cycle? binder repr)
  (hashq-ref (hfield-ref binder 'ht-all-cycles) repr))