-
Notifications
You must be signed in to change notification settings - Fork 1
/
prim.rkt
38 lines (33 loc) · 1.42 KB
/
prim.rkt
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
#lang racket
(require "env.rkt"
"mutrec.rkt")
(define (set-prims! initial-env special-env)
(set-%not! (lookup initial-env 'not))
(set-%cons! (lookup initial-env 'cons))
(set-%eq?! (lookup initial-env 'eq?))
(set-%<! (lookup initial-env '<))
(set-%eqv?! (lookup initial-env 'eqv?))
(set-%equal?! (lookup initial-env 'equal?))
(set-%null?! (lookup initial-env 'null?))
(set-%pair?! (lookup initial-env 'pair?))
(set-%vector! (lookup initial-env 'vector))
(set-%make-vector! (lookup initial-env 'make-vector))
(set-%vector-ref! (lookup initial-env 'vector-ref))
(set-%car! (lookup initial-env 'car))
(set-%cdr! (lookup initial-env 'cdr))
(set-%read! (lookup initial-env 'read))
(set-%eval! (lookup initial-env 'eval))
(set-%get! (lookup initial-env 'eval))
(set-%expand-once! (lookup initial-env 'eval))
(set-%internal-apply! (lookup special-env 'internal-apply))
(set-%Qvector! (lookup special-env 'qvector))
(set-%Qlist! (lookup special-env 'qlist))
(set-%Qcons! (lookup special-env 'qcons))
(set-%Qbox! (lookup special-env 'qbox))
(set-%Qmerge-list! (lookup special-env 'qmerge-list))
(set-%make-closure! (lookup special-env 'make-closure))
(set-%closure-ref! (lookup special-env 'closure-ref))
(set-%closure-set!! (lookup special-env 'closure-set!))
(set-%box! (lookup initial-env 'box))
(set-%unbox! (lookup initial-env 'unbox))
(set-%set-box!! (lookup initial-env 'set-box!)))