Public Vars

Back

extends? (clj)

(source)

function

(extends? protocol atype)
Returns true if atype extends protocol

Examples

mikera/core.matrix
(ns clojure.core.matrix.test-utils
  (:refer-clojure :exclude [vector?])
  (:require [clojure.core.matrix.protocols :as mp]
            [clojure.core.matrix :refer :all]
            [clojure.core.matrix.utils :refer [extends-deep? extract-protocols]]
            [clojure.test :refer :all])
  (:import [clojure.lang PersistentVector]
           [mikera.vectorz Vector]))

;; this tests that all protocols have a default implementation for java.lang.Object
;; (except for specified known exceptions
(deftest test-default-implementations
  (is (= #{'PIndexedSettingMutable 'PMatrixRank 'PGenericOperations 'PDatasetImplementation}
         (set (map :name (filter #(not (extends? % Object)) (extract-protocols)))))))