/usr/lib/gambc4/_eval#.scm is in libgambc4 4.2.8-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 | ;;;============================================================================
;;; File: "_eval#.scm", Time-stamp: <2007-05-27 22:22:01 feeley>
;;; Copyright (c) 1994-2007 by Marc Feeley, All Rights Reserved.
;;;============================================================================
;;; Representation of exceptions.
(define-library-type-of-exception expression-parsing-exception
id: 5279db3c-9e07-4e8c-913f-29a7d61ee626
constructor: #f
opaque:
(kind unprintable: read-only:)
(source unprintable: read-only:)
(parameters unprintable: read-only:)
)
(define-library-type-of-exception unbound-global-exception
id: 2cea29df-7f3e-489d-bf83-5925c5081151
constructor: #f
opaque:
(code unprintable: read-only:)
(rte unprintable: read-only:)
(variable unprintable: read-only:)
)
;;;----------------------------------------------------------------------------
;;; Miscellaneous macros.
(##define-macro (macro-true? x) x)
(##define-macro (macro-unbound? x) `(##unbound? ,x))
(##define-macro (macro-self-var) ''##self)
(##define-macro (macro-selector-var) ''##selector)
(##define-macro (macro-do-loop-var) ''##do-loop)
;;;----------------------------------------------------------------------------
;;; Macros to manipulate nodes of executable code.
(##define-macro (macro-make-code code-prc cte src stepper subcodes . lst)
`(let (($code (##vector #f ,code-prc ,cte ,src ,stepper ,@subcodes ,@lst)))
,@(let loop ((l subcodes) (i 5) (r '()))
(if (pair? l)
(loop (cdr l)
(+ i 1)
(cons `(##vector-set! (##vector-ref $code ,i) 0 $code) r))
(reverse r)))
$code))
(##define-macro (macro-code-link c)
`(##vector-ref ,c 0))
(##define-macro (macro-code-cprc c)
`(##vector-ref ,c 1))
(##define-macro (macro-code-cte c)
`(##vector-ref ,c 2))
(##define-macro (macro-code-locat c)
`(##vector-ref ,c 3))
(##define-macro (macro-code-locat-set! c l)
`(##vector-set! ,c 3 ,l))
(##define-macro (macro-code-stepper c)
`(##vector-ref ,c 4))
(##define-macro (macro-code-length c)
`(##fixnum.- (##vector-length ,c) 5))
(##define-macro (macro-code-ref c n)
`(##vector-ref ,c (##fixnum.+ ,n 5)))
(##define-macro (macro-code-set! c n x)
`(##vector-set! ,c (##fixnum.+ ,n 5) ,x))
(##define-macro (^ n)
`(##vector-ref $code ,(+ n 5)))
(##define-macro (macro-is-child-code? child parent)
`(let ((child ,child)
(parent ,parent))
(and (##vector? child)
(##fixnum.< 3 (##vector-length child))
(##eq? (macro-code-link child) parent))))
(##define-macro (macro-code-run c)
`(let (($$code ,c))
((##vector-ref $$code 1) $$code rte)))
;;;----------------------------------------------------------------------------
;;; Macros to create the "code procedure" associated with a code node.
(##define-macro (macro-make-cprc . body)
`(let ()
(##declare (not inline) (not interrupts-enabled) (environment-map))
(lambda ($code rte)
(let (($$continue
(lambda ($code rte)
(##declare (inline))
,@body)))
(##declare (interrupts-enabled))
($$continue $code rte)))))
(##define-macro (macro-make-gen params . def)
`(let ()
(##declare (not inline))
(lambda (cte tail? src ,@params) ,@def)))
(##define-macro (macro-gen proc src . args)
`(,proc cte tail? ,src ,@args))
;;;----------------------------------------------------------------------------
;;; Macros for single stepping.
(##define-macro (macro-call-step! vars . body)
`(macro-step! #t 1 ,vars ,@body))
(##define-macro (macro-future-step! vars . body)
`(macro-step! #f 2 ,vars ,@body))
(##define-macro (macro-delay-step! vars . body)
`(macro-step! #f 2 ,vars ,@body))
(##define-macro (macro-lambda-step! vars . body)
`(macro-step! #f 3 ,vars ,@body))
(##define-macro (macro-define-step! vars . body)
`(macro-step! #f 4 ,vars ,@body))
(##define-macro (macro-set!-step! vars . body)
`(macro-step! #f 5 ,vars ,@body))
(##define-macro (macro-reference-step! vars . body)
`(macro-step! #f 6 ,vars ,@body))
(##define-macro (macro-constant-step! vars . body)
`(macro-step! #f 7 ,vars ,@body))
(##define-macro (macro-make-no-stepper)
''#(#(#f #f #f #f #f #f #f) #f #f #f #f #f #f #f))
(##define-macro (macro-make-step-handlers)
'(##vector ##step-handler
##step-handler
##step-handler
##step-handler
##step-handler
##step-handler
##step-handler))
(##define-macro (macro-make-main-stepper)
'(##vector (##vector-copy ##step-handlers)
#f
#f
#f
#f
#f
#f
#f))
(##define-macro (macro-step! leapable? handler-index vars . body)
`(let* (($$execute-body
(lambda ($code rte ,@vars) ,@body))
($$handler
(##vector-ref (macro-code-stepper $code) ,handler-index)))
(if $$handler
($$handler ,leapable?
$code
rte
(lambda ($code rte ,@vars)
($$execute-body $code rte ,@vars))
,@vars)
($$execute-body $code rte ,@vars))))
;;;----------------------------------------------------------------------------
;;; Macros to manipulate the runtime environment
(##define-macro (macro-make-rte rte . lst)
`(##vector ,rte ,@lst))
(##define-macro (macro-make-rte* rte ns)
`(let (($rte (##make-vector (##fixnum.+ ,ns 1) '#!unbound)))
(##vector-set! $rte 0 ,rte)
$rte))
(##define-macro (macro-rte-up rte) `(##vector-ref ,rte 0))
(##define-macro (macro-rte-ref rte i) `(##vector-ref ,rte ,i))
(##define-macro (macro-rte-set! rte i val) `(##vector-set! ,rte ,i ,val))
;;;----------------------------------------------------------------------------
(##define-macro (define-runtime-macro pattern . rest)
(define (form-size parms) ;; this definition must match the one in "_eval.scm"
(let loop ((lst parms) (n 1))
(cond ((pair? lst)
(let ((parm (car lst)))
(if (memq parm '(#!optional #!key #!rest))
(- n)
(loop (cdr lst)
(+ n 1)))))
((null? lst)
n)
(else
(- n)))))
(let ((src `(lambda ,(cdr pattern) ,@rest)));;;;;;;; lambda --> ##lambda
`(##top-cte-add-macro!
##interaction-cte
',(car pattern)
(##make-macro-descr
#f
',(form-size (cdr pattern))
,src
#f))))
(##define-macro (define-runtime-syntax name expander)
`(##top-cte-add-macro!
##interaction-cte
',name
(##make-macro-descr
#t
-1
,expander
#f)))
;;;============================================================================
|