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:
@@ -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")
|
||||
|
Reference in New Issue
Block a user