Suggest vary-meta in place of (with-meta a (f (meta a) ,,,))

This commit is contained in:
James Brennan 2016-04-03 19:15:53 -07:00
parent be013ef0d3
commit 6be43fb040
2 changed files with 5 additions and 2 deletions

View file

@ -103,7 +103,8 @@
;; Other
[(not (some ?pred ?coll)) (not-any? ?pred ?coll)])
[(not (some ?pred ?coll)) (not-any? ?pred ?coll)]
[(with-meta ?x (?f (meta ?x) . ?arg)) (vary-meta ?x ?f . ?arg)])
(comment

View file

@ -41,4 +41,6 @@
'(form arg) '(->> arg form)
'(:form arg) '(->> arg :form)
'(first-of-form rest-of-form arg) '(->> arg (first-of-form rest-of-form))
'(not-any? pred coll) '(not (some pred coll))))
'(not-any? pred coll) '(not (some pred coll))
'(vary-meta arg f) '(with-meta arg (f (meta arg)))
'(vary-meta arg f :a :b :c) '(with-meta arg (f (meta arg) :a :b :c))))