Skip to content
Browse files

Version 0.1.3

  • Loading branch information...
1 parent 0bd50e6 commit 16a5f7e2db03633782d55f594601858bad577bba @frenchy64 committed Dec 3, 2012
Showing with 17 additions and 12 deletions.
  1. +3 −2 README.md
  2. +2 −2 project.clj
  3. +7 −0 src/typed/ann.clj
  4. +2 −2 src/typed/check_cljs.clj
  5. +1 −1 src/typed/parse.clj
  6. +2 −5 src/typed/type_rep.clj
View
5 README.md
@@ -14,15 +14,16 @@ See `LICENSE`.
Leiningen (Clojars):
-`[typed "0.1.2"]`
+`[typed "0.1.3"]`
# Changelog
-0.1.3-SNAPSHOT
+0.1.3
- Refactor typed.core into individual files
- Add `method-type`
- `(method-type 'java.io.File/getName)` prints the current Typed Clojure type for the getName method of File
- Add types for some clojure.core coersion functions
+ - Preliminary support for ClojureScript
0.1.2
- Fix objects and filters being lost during polymorphic and dotted function applications
View
4 project.clj
@@ -1,6 +1,6 @@
-(defproject typed "0.1.3-SNAPSHOT"
+(defproject typed "0.1.3"
:description "Gradual typing for Clojure"
- :dependencies [[analyze "0.3-SNAPSHOT"]
+ :dependencies [[analyze "0.2.1"]
[net.intensivesystems/arrows "1.3.0"] ;for testing conduit, lein test wants it here?
[trammel "0.7.0"]
[org.clojure/math.combinatorics "0.0.2"]
View
7 src/typed/ann.clj
@@ -193,6 +193,13 @@
(ann clojure.core/atom (All [x] [x -> (Atom x x)]))
+
+(comment
+ (ann clojure.core/atom (All [x] [x & {(U nil (IPersistentMap Any Any)) :meta
+ (U nil [x -> Any]) :validator}
+ -> (Atom x x)]))
+ )
+
(ann clojure.core/deref (All [x y]
(Fn [(IDeref x) -> x]
[(IDeref x) AnyInteger y -> (U x y)])))
View
4 src/typed/check_cljs.clj
@@ -289,7 +289,7 @@
(defmethod check-cljs :fn
[{:keys [name max-fixed-arity methods variadic] :as expr} & [expected]]
- (when expected (prn 'fn-expected (unparse-type (ret-t expected))))
+ #_(when expected (prn 'fn-expected (unparse-type (ret-t expected))))
(binding [*check-fn-method1-checkfn* check-cljs]
(assoc expr
expr-type
@@ -336,7 +336,7 @@
(defmethod check-cljs :if
[{:keys [test then else] :as expr} & [expected]]
(let [ctest (check-cljs test)]
- (prn "check-cljs :if" (expr-type ctest))
+ #_(prn "check-cljs :if" (expr-type ctest))
(assoc expr
expr-type (binding [*check-if-checkfn* check-cljs]
(check-if (expr-type ctest) then else expected)))))
View
2 src/typed/parse.clj
@@ -210,7 +210,7 @@
(declare parse-function)
(defn parse-fn-intersection-type [[Fn & types]]
- (apply make-FnIntersection (doall (map parse-function types))))
+ (apply make-FnIntersection (mapv parse-function types)))
(defmethod parse-type-list 'Fn
[syn]
View
7 src/typed/type_rep.clj
@@ -639,18 +639,15 @@
(defrecord KwArgs [mandatory optional]
"A set of mandatory and optional keywords"
- [(map? mandatory)
- (map? optional)
- (every? Value? (map keys [mandatory optional]))
- (every? Type? (map vals [mandatory optional]))])
+ [(every? (hash-c? Value? Type?) [mandatory optional])])
(defrecord Function [dom rng rest drest kws]
"A function arity, must be part of an intersection"
[(or (nil? dom)
(sequential? dom))
(every? Type? dom)
(Result? rng)
- (<= (count (filter identity [rest drest kws])) 1)
+ (<= (count (remove nil? [rest drest kws])) 1)
(or (nil? rest)
(Type? rest))
(or (nil? drest)

0 comments on commit 16a5f7e

Please sign in to comment.
Something went wrong with that request. Please try again.