On Fri, Jun 26, 2009 at 5:12 PM, Kai<poki...@gmail.com> wrote: > > I'm new to this discussion group and Clojure.
Welcome! > I'm sharing the first > "bigger-than-REPL" script that I've written because I haven't seen > anything else like it for Clojure. It's a script that takes Clojure > code as input and generates a pretty HTML version. You can view it > here (I ran the script through itself): > > http://kai.myownsiteonline.com/clojure/html.clj.html The results are attractive, thanks for sharing! I see you've copied 'spit' from clojure.contrib.duck-streams. While of course it's perfectly acceptable to re-use open-source code, it is important that when you copy an author's code, that you follow the rules laid out by that author. In this case there are implications for the license of your own code. At the very least it would be polite to give credit. Anyway, I assume this was an innocent oversight and that you'll fix it soon. > I'd appreciate comments on the coding style Well, since you ask... :-) Your use of sets in 'whitespace?', 'starting?', etc. is excellent. You could similarly use maps for 'html-entity' and 'html-whitespace' -- 'get' accepts a default value, which might be useful here. ...and now that I'm looking at it, I think even 'whitespace?' could be just: (def whitespace? #{\, \newline \tab \space}) Also, you might be interested in 'condp' -- it'd be useful in several places in that file. Thanks again for sharing your code, --Chouser --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---