Phase 3: add intern dispatch arm to evaluator.janet
This commit is contained in:
parent
9799ed0559
commit
fc7f49487b
1 changed files with 5 additions and 0 deletions
|
|
@ -586,6 +586,11 @@
|
|||
(apply alter-meta! v f args))
|
||||
"reset-meta!" (reset-meta! (eval-form ctx bindings (in form 1))
|
||||
(eval-form ctx bindings (in form 2)))
|
||||
"intern" (let [ns-name (eval-form ctx bindings (in form 1))
|
||||
sym-name (eval-form ctx bindings (in form 2))
|
||||
val (eval-form ctx bindings (in form 3))
|
||||
ns (ctx-find-ns ctx (if (struct? ns-name) (ns-name :name) ns-name))]
|
||||
(ns-intern ns (if (struct? sym-name) (sym-name :name) sym-name) val))
|
||||
"locking" (eval-form ctx bindings (in form 2))
|
||||
"instance?" (let [type-sym (in form 1)
|
||||
val (eval-form ctx bindings (in form 2))]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue