protocol | since v0.0-927 | clojure.lang/IPersistentStack | Edit |
Protocol for collections to provide access to their items as stacks. The top of the stack should be accessed in the most efficient way for the different data structures.
(defprotocol IStack
(-peek [coll]
"Returns the item from the top of the stack. Is used by cljs.core/peek.")
(^clj -pop [coll]
"Returns a new stack without the item on top of the stack. Is used
by cljs.core/pop."))