mirror of
https://github.com/janet-lang/janet
synced 2024-12-01 04:19:55 +00:00
added thaw to complement freeze
This commit is contained in:
parent
f2197fa2d8
commit
56d927c72d
@ -2142,6 +2142,19 @@
|
|||||||
:buffer (string x)
|
:buffer (string x)
|
||||||
x))
|
x))
|
||||||
|
|
||||||
|
(defn thaw
|
||||||
|
`Thaw an object (make it mutable) and do a deep copy, making
|
||||||
|
child value also mutable. Closures, fibers, and abstract
|
||||||
|
types will not be recursively thawed, but all other types will`
|
||||||
|
[ds]
|
||||||
|
(case (type ds)
|
||||||
|
:table (walk-dict thaw ds)
|
||||||
|
:struct (walk-dict thaw ds)
|
||||||
|
:array (walk-ind thaw ds)
|
||||||
|
:tuple (walk-ind thaw ds)
|
||||||
|
:string (buffer ds)
|
||||||
|
ds))
|
||||||
|
|
||||||
(defn macex
|
(defn macex
|
||||||
``Expand macros completely.
|
``Expand macros completely.
|
||||||
`on-binding` is an optional callback for whenever a normal symbolic binding
|
`on-binding` is an optional callback for whenever a normal symbolic binding
|
||||||
|
Loading…
Reference in New Issue
Block a user