On Aug 26, 2010, at 8:07 AM, Jacek Laskowski wrote:

> Hi,
> 
> Right in the middle of Clojure and Rails - the Secret Sauce Behind
> FlightCaster [1] I came across print-dup function. I thought I'd find
> out a bit more about it using (doc print-dup) which eventually
> yielded:
> 
> devmac:~ jacek$ clj
> Clojure 1.2.0
> user=> (doc print-dup)
> -------------------------
> clojure.core/print-dup
> nil
>  nil
> nil
> 
> Is it how it's supposed to present itself? Why's nil-rich? Is that
> something a newbie (=me) should not bother himself?
> 
> [1] http://www.infoq.com/articles/flightcaster-clojure-rails

print-dup a multimethod defined in support of the *print-dup* mechanism. It's 
the latter that is part of the public API:

user=> (doc *print-dup*)
-------------------------
clojure.core/*print-dup*
nil
  When set to logical true, objects will be printed in a way that preserves
  their type when read in later.

  Defaults to false.
nil
user=> 

I think it would be an improvement if print-dup were given a small doc-string 
pointing to the public var: "see *print-dup*".

Regarding the nils, the first is the argument list. Currently for multimethods 
it's always nil. It might be a nice improvement to include the argument list(s) 
of the dispatch function there when available.

The second is the doc string, undefined currently for print-dup.

The third is the return value from the call to "doc".

--Steve

-- 
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

Reply via email to