On Oct 24, 2008, at 12:18 PM, Stuart Sierra wrote:

> On Oct 24, 2:55 am, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote:
>> I've uploaded a patch that implements Common Lisp's *print-length*  
>> and
>> *print-level* for Clojure:
>
> Really nice.  Thanks, Stephen!

Thanks! :-)

> Could the *print-level* cutoff
> indicator be something more visible than '#'?  Maybe '#=(...)' or
> something.

I went with Common Lisp precedent. Thinking about it further, it seems  
it would be nice to use something that's guaranteed unreadable.  As it  
is now, it will be a \# followed by a collection-dependent separator  
or by a collection-dependent "end" character (like \) or \] or \}).  
Perhaps it would be better to print a known, fixed dispatch character  
right after the \# so that the entire thing is guaranteed unreadable.  
Do we have a dispatch character reserved for that already?

> I've attached a patch to add *print-str-length* that does the same
> thing for strings:
>
> user=> (set! *print-str-length* 30)
> 30
> user=> (slurp "bigfile.xml")
> "<?xml version=\"1.0\" encoding=\"..."
> user=> (count *1)
> 2540

Neat. I like it.

> I feel like these variables should be named '*pr-level*' and so on,
> since they affect 'pr' and 'pr-str' but not 'print'.

*print-length* and *print-level* do affect print and println as well  
as pr and prn and pr-str.

--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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to