Last active
December 22, 2015 05:49
-
-
Save sherbondy/6426552 to your computer and use it in GitHub Desktop.
definition missing complaint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ns rt.core | |
(:refer-clojure :exclude [+ - * /]) | |
(:require [clojure.core.typed :as typed | |
:refer [ann ann-datatype ann-form ann-record check-ns tc-ignore]]) | |
(:require [clojure.algo.generic.arithmetic :as arith :refer [+ - * /]])) | |
(ann-record Vec3 [x :- Number y :- Number z :- Number]) | |
(defrecord Vec3 [x y z]) | |
(ann ^:no-check clojure.algo.generic.arithmetic/+ [Vec3 Vec3 -> Vec3]) | |
(defmethod + [Vec3 Vec3] | |
[{x :x y :y z :z} {a :x b :y c :z}] | |
(Vec3. (+ x a) (+ y b) (+ z c))) | |
(+ (Vec3. 1 2 3) (Vec3. 3 4 5)) | |
;; (check-ns) :ok | |
~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment