Public Vars

Back

Vec (clj)

(source)

type

Examples

viebel/klipse
(ns clojure.core.rrb-vector.interop
  (:require [clojure.core.rrb-vector.protocols
             :refer [PSliceableVector -slicev
                     PSpliceableVector -splicev]]
            [clojure.core.rrb-vector.rrbt :refer [-as-rrbt]]))

(extend-protocol PSliceableVector
  cljs.core/PersistentVector
  (-slicev [v start end]
    (-slicev (-as-rrbt v) start end))

(extend-protocol PSpliceableVector
  cljs.core/PersistentVector
  (-splicev [v1 v2]
    (-splicev (-as-rrbt v1) v2))
mikera/core.matrix
   Indexes are intended to be used to specify elements, ranges or sub-arrays of core.matrix arrays.
   As such they can be considered as a 1D vector of integer values."
  (:require [clojure.core.matrix.protocols :as mp]
            [clojure.core.matrix.macros :refer [error]])
  (:import [clojure.lang IPersistentVector]))

(extend-protocol mp/PIndexImplementation
  IPersistentVector
	  (index? [m]
      (every? integer? m))
	  (index-to-longs [m]
      (long-array m))
	  (index-to-ints [m]
      (int-array m))
	  (index-from-longs [m xs]
      (vec xs))
	  (index-from-ints [m xs]
      (vec xs))
	  (index-coerce [m a]
      (cond
        (mp/index? a)
          (mp/persistent-vector-coerce a)
        (== 1 (long (mp/dimensionality a)))
          (vec (mp/index-to-longs a))
        :else
          (error "Can't make a 1D index from array of shape " (mp/get-shape a)))))
clojure/core.rrb-vector
(ns clojure.core.rrb-vector.interop
  (:require [clojure.core.rrb-vector.protocols
             :refer [PSliceableVector slicev
                     PSpliceableVector splicev]]
            [clojure.core.rrb-vector.rrbt :refer [as-rrbt]])
  (:import (clojure.core Vec)
           (clojure.lang PersistentVector APersistentVector$SubVector)
           (clojure.core.rrb_vector.rrbt Vector)))

(extend-protocol PSliceableVector
  Vec
  (slicev [v start end]
    (slicev (as-rrbt v) start end))

  PersistentVector
  (slicev [v start end]
    (slicev (as-rrbt v) start end))

  APersistentVector$SubVector
  (slicev [v start end]
    (slicev (as-rrbt v) start end)))

(extend-protocol PSpliceableVector
  Vec
  (splicev [v1 v2]
    (splicev (as-rrbt v1) v2))

  PersistentVector
  (splicev [v1 v2]
    (splicev (as-rrbt v1) v2))

  APersistentVector$SubVector
  (splicev [v1 v2]
    (splicev (as-rrbt v1) v2)))
techascent/tech.datatype
(ns tech.v2.datatype.vector-of
  "Bindings to the vectors produced by vector-of"
  (:require [tech.v2.datatype.protocols :as dtype-proto]
            [tech.v2.datatype.typecast :as typecast]
            [tech.v2.datatype.casting :as casting])
  (:import [clojure.core Vec ArrayManager]))


(extend-type Vec
  dtype-proto/PDatatype
  (get-datatype [item]
    (dtype-proto/get-datatype
     (.array ^ArrayManager (.am item) 1)))
  dtype-proto/PClone
  (clone [item] item)
  dtype-proto/PToReader
  (convertible-to-reader? [item] true)
  (->reader [item options]
    (let [item-dtype (dtype-proto/get-datatype item)
          new-reader (list-reader item-dtype item)
          final-dtype (or (:datatype options) item-dtype)]
      (if (= final-dtype item-dtype)
        new-reader
        (dtype-proto/->reader new-reader options))))
  dtype-proto/PBuffer
  (sub-buffer [item offset length]
    (dtype-proto/sub-buffer (dtype-proto/->reader item nil) offset length)))
ToxicFrog/bltool
(ns bltool.data.default
  (:require [bltool.flags :refer :all])
  (:require [clojure.core.typed :as t :refer [fn> ann]])
  (:require [slingshot.slingshot :refer [throw+]]))

(t/def-alias BLGame '{:id String :name String :platform String :progress String})
(t/def-alias BLGameList (t/Vec BLGame))