The problem with using type hints for doc is, that they actually alter
runtime behavior, non - locally:
- They replace expensive reflective method call sites with casts to a known
type
- Hence they effectively narrow the accepted type at the call site
- They change the exception thrown in error cases to ClassCastException

None of those caveats may be a problem for your use case, but they are the
reason type hints
are considered an optimization technique rather than documentation.

Also for real documentation, type hints lack expressivenes (unions?
parameters? function types?).

For using types as documentation, while also being able to statically check
them, keep an eye out for
https://github.com/frenchy64/typed-clojure

kind regards

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to