Excerpts from Alex Robbins's message of 2012-07-06 05:27:28 -0700: > Reading through your code, many of your functions have large cond or > condp clauses. Sometimes those can be replaced with multimethods.
Thanks, that's good to know. I think in this case the large condp switches are part and parcel of fact that it's lexing and parsing strings. If they get too large I may refactor into multimethods. I was really hoping for some Clojure experts to weigh in on these style questions below. Anyone? (E.g. surely people don't use the repl with single-line uninformative error messages... what am I doing wrong?) > > - What's a good way to signal errors (e.g. parse errors)? I found the > > slingshot library, which seemed to provide nice exceptions, but I'm a > > little leery of pulling in a non-stdlib library just for this. Is > > there a more standard way to signal exceptional circumstances? > > > > - Once a template is compiled, rather than relying on structs or hashes > > to provide data, I used dynamic bindings. So you can provide a > > function that fills in the data. Is this a good idea or a bad one? > > (See example 1.) > > > > - A lot of the iteration code seemed to naturally take the form: > > (defn whatever [args] > > (let [new-args > > (some complicated stuff)] > > (recur new-args))) > > > > So all the complicated code is indented 9 spaces from the function > > declaration right off the bat. Is there a better way to structure > > things so that I get a little more breathing room? > > > > - I'm happy developing from the repl, but debugging was often painful. > > I would get a one-line error message about e.g. an arity mismatch, > > with no stacktrace and no way to tell where the error occurred. I see > > references to third-party tracing libraries. Is this what people use? > > Is there really no stacktrace available when you an error happens? > > > > Thanks for any advice! > > > > -- > > William > > > > -- > > 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 > -- William <wmor...@masanjin.net> -- 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