robert-strandh / SICL

A fresh implementation of Common Lisp
Other
1.07k stars 79 forks source link

Define primop, AST class, and HIR instruction class for the unbound slot value. #189

Open robert-strandh opened 4 years ago

robert-strandh commented 4 years ago

Currently, the unbound slot value is defined as a Common Lisp constant. But defining it that way has two negative consequences. First, it can escape from the environment, and that is not desirable. Second, during bootstrapping, it needs to be defined specially with a different value, so the production version can not be used.

By defining it as a primop, AST class and HIR instruction class, during bootstrapping we can use the production version of code that needs to check for the unbound value. Then, the AST evaluator and the HIR evaluator can be configured to use the special bootstrapping value, whereas the HIR-to-MIR translator will use the native value.