We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7dd29ae commit ca9150bCopy full SHA for ca9150b
2 files changed
pixie/stdlib.pxi
@@ -2717,3 +2717,9 @@ Calling this function on something that is not ISeqable returns a seq with that
2717
(if (satisfies? IComparable x)
2718
(-compare x y)
2719
(throw [::ComparisonError (str x " does not satisfy IComparable")])))
2720
+
2721
+(defn vary-meta
2722
+ [x f & args]
2723
+ "Returns x with meta data updated with the application of f and args to it.
2724
+ex: (vary-meta x assoc :foo 42)"
2725
+ (with-meta x (apply f (meta x) args)))
tests/pixie/tests/test-stdlib.pxi
@@ -691,3 +691,6 @@
691
(t/assert= m (map-entry :a 1))
692
(t/assert= m [:a 1])
693
(t/assert= m '(:a 1))))
694
695
+(t/deftest vary-meta
696
+ (t/assert= 42 (-> {} (vary-meta assoc :foo 42) meta :foo)))
0 commit comments