JanetDocsSourcePlaygroundI'm feeling luckyCommunityGitHub sign in
(update @{:data @[:cherry :orange]} :data (comp sorted |(array/push $ :apple))) # => {:data @[:apple :cherry :orange]} # note that all data structures must be mutable with @ (def c @{:size :small :roast :dark :add-ins @[:soy :almond :soy]}) (defn add! [coffee extra] (update coffee :extras (comp sort |(array/push $ extra)))) (add! c :chocolate)