1
0
mirror of https://github.com/janet-lang/janet synced 2024-12-02 21:09:55 +00:00
janet/libs/serialize.gst

23 lines
433 B
Plaintext
Raw Normal View History

2017-05-12 01:30:18 +00:00
(export! "scheck" (fn [x]
(: dat (serialize x))
(: deser (deserialize dat))
(print (debugp deser))
deser
))
(scheck 1)
(scheck true)
(scheck nil)
(scheck "asdasdasd")
(scheck (struct 1 2 3 4))
(scheck (tuple 1 2 3))
(scheck 123412.12)
(scheck (funcdef (fn [] 1)))
(scheck (funcenv (fn [] 1)))
2017-05-12 04:03:00 +00:00
(do
(: producer (fn [a] (fn [] a)))
(: f (producer "hello!"))
(scheck (funcenv f))
)
2017-05-12 01:30:18 +00:00
(scheck (fn [] 1))