I've never used a dynamically-typed language and an issue I've encountered 
with Clojure is a difficulty with readily "seeing" the data structures 
being consumed or returned by functions I'm writing, especially when I come 
back to them several days later and if those structures get to be somewhat 
nested or otherwise complex.

As a small concrete example, lets say that I currently have a function that 
accepts data that looks like {:a "A" :b "B"} and, at some point I change 
the internals of the function to instead operate on data that looks like 
[[:a "A"] [:b "B"]].

I could see the docstring communicating that the initial implementation of 
the function accepts a map, and then perhaps it boils down to finding 
suitable language to describe the structure in the revised implementation 
("sequence of pairs", "relation", or some other language suitable to the 
abstraction).

I suppose this is no different than the "documentation" aspect that 
generics provided in Java when we went from raw types like List to 
List<String>, but, of course, generics can get unwieldy rather quickly with 
things like List<Map<String,Set<Integer>>>.

Does there exist idiomatic language that developers employ in their 
docstrings to quickly convey this kind of info? I see that the docstrings 
for clojure.core are fairly readable, but they tend to operate on very 
simple data structures.

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to