1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-16 16:27:40 +00:00

Add lookups for marshalling and unmarshalling.

Allow generating lookup tables from the current environment.
This commit is contained in:
Calvin Rose
2018-10-21 01:35:07 -04:00
parent c3ba613959
commit 98f2c6feab
8 changed files with 133 additions and 41 deletions

View File

@@ -141,9 +141,11 @@
# Marshal
(def [m-lookup um-lookup] (env-lookups _env))
(defn testmarsh [x msg]
(def marshx (marshal x))
(def out (-> marshx unmarshal marshal))
(def marshx (marshal x m-lookup))
(def out (marshal (unmarshal marshx um-lookup) m-lookup))
(assert (= (string marshx) (string out)) msg))
(testmarsh nil "marshal nil")