-
Notifications
You must be signed in to change notification settings - Fork 2
compile eval
TurtleKitty edited this page May 11, 2019
·
2 revisions
This allows the programmer to define variables and procedures for use by operators during compile time. The things so defined will disappear before runtime.
; without compile-eval
(def x 1)
(proc adder (n)
(+ n 10))
(op make-11 ()
(adder x))
(make-11) ; (compile-error (undefined-symbol adder "Name not defined."))
; with compile-eval
(compile-eval
(def x 1)
(proc adder (n)
(+ n 10)))
(op make-11 ()
(adder x))
(make-11) ; 11
x ; (runtime-error (undefined-symbol x "Name not defined."))