      (alter-meta! #'->AssociativeSpec assoc :private true)
      (alter-meta! #'->IndexedSpec assoc :private true)))
 
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Spec Constructors
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(defmulti spec
+;; --- Spec Constructors
+
+(defn- associative-spec
+  [& params]
+  (let [data (mapv vec (partition 2 params))
+        dict (into {} data)
+        types (map second data)]
+    (AssociativeSpec. data dict types)))
+
+(defn- indexed-spec
+  [& types]
+  (IndexedSpec. types))
+
+(defn spec
   "Polymorphic constructor for Spec instances.
 
   Spec is a some kind of composition of arbitrary

  "Abstraction for calculate size for dynamic specs."
  (size* [_ data] "Calculate the size in bytes of the object having a data."))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Composed Spec Types
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(deftype AssociativeSpec [data dict types]
  #?@(:clj


  The same rules applies for writing data into a
  buffer."
  [& params]
  (let [numparams (count params)]
    (cond
      (every? #(satisfies? ISpec %) params)
      (apply indexed-spec params)

      (and (even? numparams)
           (keyword? (first params))
           (satisfies? ISpec (second params)))
      (apply associative-spec params)

      :else
      (throw (ex-info "Invalid arguments" {})))))

(defn repeat
  "Creare a composed typespec that repeats `n` times
