-
Notifications
You must be signed in to change notification settings - Fork 0
/
link.lisp
33 lines (29 loc) · 1.21 KB
/
link.lisp
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
(in-package #:cvm.machine)
;;; Retrieve information from an environment based on a name.
;;; These are used both by the evaluator/compiler (compile.lisp)
;;; and the loader (loadltv.lisp).
;;; Given a function name, return a cell that the VM
;;; FDEFINITION instruction can get an actual function from.
(defgeneric link-function (client environment function-name)
;; default: use the name itself as a cell.
;; VM FDEFINITION will just use CL:FDEFINITION.
(:method (client env fname)
(declare (ignore client env))
fname))
;;; Given a variable name, return a cell that the VM
;;; SPECIAL-BIND etc. instructions can use to access the
;;; variable's bindings and values.
(defgeneric link-variable (client environment variable-name)
;; default: use the name itself as a cell.
(:method (client env vname)
(declare (ignore client env))
vname))
;;; Return an environment that the VM PROGV and FDESIGNATOR
;;; instructions can use to perform lookups.
(defgeneric link-environment (client environment)
;; default: just return the given environment.
;; It seems unlikely any client will need to customize this,
;; but it's included for completeness.
(:method (client env)
(declare (ignore client))
env))