                 (parse-number-lists spins))]
     d-sym))
 
-(defmethod dsymbol DSymbol [ds] ds)
-
-(defmethod dsymbol DelaneySymbol [ds]
+(defn- ds-from-ds [ds]
   (let [emap (zipmap (elements ds) (range 1 (inc (size ds))))
         imap (zipmap (indices ds) (range (inc (dim ds))))
         gluings (for [i (indices ds), D (orbit-reps ds [i])]

          ds
          (range (count spins))))

(defmethod dsymbol String [code]
  (let [parts (-> code s/trim
                (s/replace #"^<" "") (s/replace #">$" "") (s/split #":"))
        [dims gluings spins] (vec (if (re-matches #"\d+\.\d+" (first parts))

                      spins)]
    d-sym))

(defprotocol DSymbolSource
  (dsymbol [_]))

(extend-type String
  DSymbolSource
  (dsymbol [code] (ds-from-str code)))

(extend-type DSymbol
  DSymbolSource
  (dsymbol [ds] ds))

(extend-type DelaneySymbol
  DSymbolSource
  (dsymbol [ds] (ds-from-ds ds)))

;; === Building a Java DSymbol instance from a Clojure one

(defn java-dsymbol [ds]
