JanetDocsPlaygroundI'm feeling luckyGitHub sign in

freeze



    function
    boot.janet on line 1925, column 1

    (freeze x)

    Freeze an object (make it immutable) and do a deep copy, making 
    child values also immutable. Closures, fibers, and abstract types 
    will not be recursively frozen, but all other types will.


2 examplesSign in to add an example
Loading...
(freeze @"Ho") #=> "Ho"
(freeze @("Ho")) #=> ("Ho")
(freeze @["Ho"]) #=> ("Ho")
(freeze @{"Ho" "Ho"}) #=> {"Ho" "Ho"}
pepePlayground
(freeze @{:a @[1 2] 
          :b @{:x @[8 9] 
               :y :smile}})
# => {:a (1 2) :b {:x (8 9) :y :smile}}
sogaiuPlayground