;; настоящая персистентная очередь FIFO: conj добавляет
;; в хвост, peek и pop берут из головы
(def int-queue (-> clojure.lang.PersistentQueue/EMPTY
(conj 1) (conj 3) (conj 5)))
;; очередь печатается необычно, поэтому показываем (vec q)
(println "queue is" (vec int-queue))
(println "top is" (peek int-queue))
(println "first is" (peek int-queue))
(println "second is" (peek (pop int-queue)))
(println "third is" (peek (pop (pop int-queue))))
;; вершина 1, затем 1, 3, 5 - первым вошёл, первым вышел