Style Question

2010-10-10 Thread Grayswx
Recently, I've been coding functions that take a map as follows. I feel like it is slightly messy, though, and was wondering if any one else could think of a reason not to do it: (defn blah ([blah-map] ;; do stuff with blah-map) ([key val & {:as blah-map}] (blah (assoc blah-map key va

Re: bug?? extend Object compilation order dependency?

2010-08-26 Thread Grayswx
Someone correct me if I'm wrong, but I think what's happening is that when you call (defprotocol Foo ...) for the second time, you're setting the symbol Foo to point to the new protocol, while the original fooed still has the old protocol. It also binds bar to a completely new function, which has

Re: Docstrings in Clojure?

2010-08-19 Thread Grayswx
On Aug 19, 4:37 pm, Joop Kiefte wrote: > (defn function-name > "Your docstring goes here" > [your argument list & more] >(call some functions)) And then you can access it with (doc function-name). (find-doc #"regexp") or (find-doc "string") searches all doc strings. There is also (clo

Re: multiline strings and multiline comments ?

2010-08-16 Thread Grayswx
For comments, there's (comment This is a comment ...). I'd say that eliminates the need for /* ... */. On Aug 16, 3:34 am, faenvie wrote: > hi clojure-users, > > i wonder what the reason is, that clojure(-reader) > does not allow > > 1. multiline-strings like scala: > >  """this is a >    | mult