Re: Pretty printing a function's symbol

2009-01-27 Thread Michael Wood
On Tue, Jan 27, 2009 at 5:38 PM, Chouser wrote: > > On Tue, Jan 27, 2009 at 9:20 AM, Daniel Jomphe wrote: >> >> Michael Wood wrote: >> >>> I've seen various code snippets where people use something# in >>> functions. Is there any point to this or gensym except in a macro? > > The suffix# isn't

Re: Pretty printing a function's symbol

2009-01-27 Thread Chouser
On Tue, Jan 27, 2009 at 9:20 AM, Daniel Jomphe wrote: > > Michael Wood wrote: > >> I've seen various code snippets where people use something# in >> functions. Is there any point to this or gensym except in a macro? The suffix# isn't made useful by being in a macro, but by being in a syntax-quo

Re: Pretty printing a function's symbol

2009-01-27 Thread Daniel Jomphe
Michael Wood wrote: > > (defn with-test-report [test fn] > > You are shadowing clojure.core/fn here. Not a problem really, but > perhaps it would be better to use a different name? Oh, and > clojure.core/test. Oh, right! Didn't think of it this way; it might be misleading to any future reader

Re: Pretty printing a function's symbol

2009-01-27 Thread Michael Wood
On Mon, Jan 26, 2009 at 10:03 PM, Daniel Jomphe wrote: > > Perry Trolard wrote: > >> You can get the symbol that names the function from the Var's >> metadata, like: >> >> user=> (:name (meta (var =))) >> = > > Thank you Perry. > > What is (var ...)? I didn't find it in the api docs, nor in the V

Re: Pretty printing a function's symbol

2009-01-26 Thread Daniel Jomphe
Daniel Jomphe wrote: > Now, all I need is to understand why my use of > (:name (meta (var expect#))) doesn't work. Hmm, seeing (var ...) is a special form, it probably doesn't evaluate its argument. Thus it tries to give me the interned symbol of the let- bound expect#, which is obviously wrong.

Re: Pretty printing a function's symbol

2009-01-26 Thread Daniel Jomphe
Daniel Jomphe wrote: > What is (var ...)? I didn't find it in the api docs, nor in the Vars > and Environment page. Sorry, I didn't search well enough; found it. Now, all I need is to understand why my use of (:name (meta (var expect#))) doesn't work. --~--~-~--~~~--

Re: Pretty printing a function's symbol

2009-01-26 Thread Daniel Jomphe
Perry Trolard wrote: > You can get the symbol that names the function from the Var's > metadata, like: > > user=> (:name (meta (var =))) > = Thank you Perry. What is (var ...)? I didn't find it in the api docs, nor in the Vars and Environment page. I'm yet to make your code work for my specifi

Re: Pretty printing a function's symbol

2009-01-26 Thread Perry Trolard
Hi Daniel, You can get the symbol that names the function from the Var's metadata, like: user=> (:name (meta (var =))) = user=> Best, Perry --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post t

Pretty printing a function's symbol

2009-01-26 Thread Daniel Jomphe
Hi, I'm learning Clojure by playing with a simple test toolkit: (fn-with-tests + [[= 2 [1 1]] [= 2 [1 1]] [= 2 [1 0]] [= 2 [2 0]]]) .. FAIL: [# 2 [1 0]] . === Tests Done === Some tests FAILED! false As you can see, I want to report t