store/[org.clojure/clojure "1.6.0"] clj::clojure.core/subvec

Official Documentation

Add notes
Arities
==================================================
   [v start]
   [v start end]

Docstring
==================================================
  Returns a persistent vector of the items in vector from
  start (inclusive) to end (exclusive).  If end is not supplied,
  defaults to (count vector). This operation is O(1) and very fast, as
  the resulting vector shares structure with the original and no
  trimming is done.

Source

(defn subvec
  "Returns a persistent vector of the items in vector from
  start (inclusive) to end (exclusive).  If end is not supplied,
  defaults to (count vector). This operation is O(1) and very fast, as
  the resulting vector shares structure with the original and no
  trimming is done."
  {:added "1.0"
   :static true}
  ([v start]
   (subvec v start (count v)))
  ([v start end]
   (. clojure.lang.RT (subvec v start end))))

Example 1

Edit
;; not supplying 'end' returns vector from 'start' to (count vector)
(subvec [12 3 4 5 6 7] 2)
;; => [4 5 6 7]

;; supplying 'end' returns vector from 'start' to element (- end 1)
(subvec [12 3 4 5 6 7] 2 4)
;; => [4 5]


Uses on crossclj