> I'm concerned that the ability to freely order comments and code will not > interact well with Clojure's namespaces.
Hmmm. If raw code is confusing because namespaces are not apparent perhaps it would help to surround the code with some natural language that explains the specific namespace used. :-) Seriously though, if you are trying to communicate from one human to another and you're aware that 'str' and 'string' both refer to 'clojure.string' but it might be ambiguous in the function under discussion, wouldn't you consider mentioning this? > What this means is that Clojure code is pretty much unreadable unless you > know the context it occurs in, specifically, you need to which namespace it > is, know the symbols that were defined above it in the file, and know the > aliases of all the namespaces referred to from this namespace. If you're using namespaces so heavily perhaps it would make sense to have a chapter/section early in the document to explain the structure and use of namespaces. > If you freely bounce around from namespace to namespace in the description > of your Clojure code, it's going to be very confusing. This suggests to me > that a well-organized literate program in Clojure would tend to document > one namespace at a time. Within a namespace, Clojure lets you move > code See? Already the notion of explaining code to the reader has led to the notion of "a well-organized literate program". Writing good, readable literature is a challenge but, hey, we're professionals. > How do you deal with this "lack of context" when you present your code in a > way that is completely unrelated to the namespace organization of your > files? Well I deal with it by using unique names rather than namespaces so I have never encountered the issue. The whole notion of namespaces feels like an attempt by Java programmers to import the com.foo... filenaming snafu into lisp. In the common lisp world I rarely ever see more than one package (namespace) so I guess I just haven't seen this as an issue. Styles vary. If you're using namespaces I presume you're also exporting an API. Logically that implies that the namespace and its functions would live in a separate chapter I suppose. Tim Daly -- -- 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/groups/opt_out.