Comment made by: steveminer@gmail.com
I just ran into this issue today. I agree it would be convenient if {{peek}} worked on a transient vector. Other functions such as {{nth}} and {{count}} work on transient vectors, so it's natural to want {{peek}}.
As a work-around (not a suggested fix), I use this:
(defn peek! [tv] (nth tv (dec (count tv))))
Admittedly, that's a misnomer but it fits the bang pattern for transient transformation of regular collection code. I also have a convenience function update!
which calls assoc!
. I offer the work-around just for users who run into this problem and want to get back to work.