We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 7dd29ae + 4994305 commit f653781Copy full SHA for f653781
2 files changed
pixie/stdlib.pxi
@@ -2717,3 +2717,11 @@ 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
+ {:doc "Returns x with meta data updated with the application of f and args to it.
2723
+ex: (vary-meta x assoc :foo 42)"
2724
+ :signatures [[x f & args]]
2725
+ :added "0.1"}
2726
+ [x f & args]
2727
+ (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 test-vary-meta
696
+ (t/assert= 42 (-> {} (vary-meta assoc :foo 42) meta :foo)))
0 commit comments