Re: (doc)strings after param in defn

2008-12-05 Thread Randall R Schulz
On Thursday 04 December 2008 23:23, Meikel Brandmeyer wrote: > Hi, > > On 5 Dez., 00:38, Randall R Schulz <[EMAIL PROTECTED]> wrote: > > ... > ... > > > And am I mistaken in my reading of the API docs for (defmulti ...) > > and (defmethod ...) or is there no accommodation in either for > > doc-str

Re: (doc)strings after param in defn

2008-12-04 Thread Meikel Brandmeyer
Hi, On 5 Dez., 00:38, Randall R Schulz <[EMAIL PROTECTED]> wrote: > Actually, I think each arity overload of a function deserves to be > independently documentable, just as each overload of a method name in a > Java class would be. I disagree. If the function of the function changes that much, t

Re: (doc)strings after param in defn

2008-12-04 Thread J. McConnell
On Thu, Dec 4, 2008 at 6:45 PM, Mon Key <[EMAIL PROTECTED]> wrote: > > So, is it idiomatic Clojure to wrap docstring in a #^{}? > > e.g. is this considered bad form: > > (defn foo > "naked docstring is ok, but rather bad form while still nice for the > relative terseness of format" > [x] > (+ x 1)

Re: (doc)strings after param in defn

2008-12-04 Thread Mon Key
> This doesn't work well with Clojure, because you can have > multiple argument vectors: > > (defn foo >"docstring here" >([x] (do-something-with-one-arg x)) >([x y] (we-can-also-do-two x y))) > > Behind which arglist should we put the docstring. ;) That makes perfect sense, this is

Re: (doc)strings after param in defn

2008-12-04 Thread Randall R Schulz
On Thursday 04 December 2008 14:41, Meikel Brandmeyer wrote: > Hi, > > Am 04.12.2008 um 18:30 schrieb Mon Key: > > It looks like I was getting turned around by the implicit do (and > > by my preconceptions coming from other Lisps where the docstring > > likes to sit behind the arglist) > > This do

Re: (doc)strings after param in defn

2008-12-04 Thread Meikel Brandmeyer
Hi, Am 04.12.2008 um 18:30 schrieb Mon Key: It looks like I was getting turned around by the implicit do (and by my preconceptions coming from other Lisps where the docstring likes to sit behind the arglist) This doesn't work well with Clojure, because you can have multiple argument vectors:

Re: (doc)strings after param in defn

2008-12-04 Thread Mon Key
> The part after the argument vector goes into the function body, which > is wrapped in a do. do evaluates the expressions and returns the > value of the last one. The results of evaluating the other expressions > are discarded. Ok. That provides the clarity I was after. Thank You. It looks li

Re: (doc)strings after param in defn

2008-12-03 Thread Stuart Halloway
> I can understand cases for passing the empty string, the empty list, > etc. However, I have trouble understanding how it isn't an error/ > exception to pass a non-empty string after the param list and have > that string be converted to nil. You are not "passing a non-empty string", you are inc

Re: (doc)strings after param in defn

2008-12-03 Thread Meikel Brandmeyer
Hi, On 4 Dez., 07:53, Mon Key <[EMAIL PROTECTED]> wrote: > So, in the case where the (doc)string is placed after the param I > should expect that REPL reads that string but doesn't necesarily > evaluate it?  Where does that string go? Does it become nil?  It > wasn't passed as a nil anymore than

Re: (doc)strings after param in defn

2008-12-03 Thread Mon Key
So, in the case where the (doc)string is placed after the param I should expect that REPL reads that string but doesn't necesarily evaluate it? Where does that string go? Does it become nil? It wasn't passed as a nil anymore than it was passed as a docstring. If i didn't intend the (doc)string

Re: (doc)strings after param in defn

2008-12-03 Thread Stephen C. Gilardi
On Dec 4, 2008, at 12:57 AM, Mon Key wrote: > I'm sure I'm missing something > > Maybe I should re address the issue in a different way; outside of > `meta' what other way is there to do a *visual* check/comparison to > test if two otherwise identical and/or nearly identical symbols > contain

Re: (doc)strings after param in defn

2008-12-03 Thread Mon Key
I forgot to add the evaluations of my-test to itself ;;; === ;;; evaluating my-test with doc string *after* param ;;; === user> my-test # ;;; === ;;; === ;;; evaluating my-test with doc string *before* param ;;;

Re: (doc)strings after param in defn

2008-12-03 Thread Mon Key
I'm sure I'm missing something Maybe I should re address the issue in a different way; outside of `meta' what other way is there to do a *visual* check/comparison to test if two otherwise identical and/or nearly identical symbols contain identical slot values? In the case where the `doc' str

Re: (doc)strings after param in defn

2008-12-03 Thread Stephen C. Gilardi
On Dec 3, 2008, at 11:35 PM, Mon Key wrote: > I apologize if this has been brought up before... But, where does > the doc string on the `my-test' defn below reside. It becomes metadata for the var that your defn form defines. You can see all the metadata with (meta (var my-test)). > If not,