On Thursday, August 25, 2016 at 9:11:39 PM UTC-5, Colin Fleming wrote:
>
>
> One thing that I think would help a lot would be if it were possible to 
> show the actual text from the failing expression rather than pretty 
> printing a seq representation of it. This would mean modifying the reader 
> such that it either caches the program text from each top-level form as it 
> reads it, or perhaps re-reading the file on an error. This means the 
> relevant code is likely to look more familiar to the user, and also avoids 
> any need to pretty print. Pretty printing is likely to be complicated since 
> it normally works top-down, and uses the type of each form to decide how to 
> lay its sub-parts out. If you're only pretty-printing a fragment from 
> within, say, a large ns form, pprint is unlikely to format it as the user 
> would expect.
>

Does the caching or file re-reading have any hope of working when you have 
nested macro expansions (like when-let -> when -> if)? The input to when in 
that case is a form constructed by when-let, not text sitting in a file. 
But maybe that doesn't matter if it's still useful for some good percentage 
of macro calls that have access to text. One benefit of using pprint is 
that you (the user) can control stuff like *print-length*, 
*print-suppress-namespace*, *print-right-margin*, etc.

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to