Colin Jones
unread,Sep 21, 2012, 3:09:32 PM9/21/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cloju...@googlegroups.com
Based on the docstring for *print-dup*, I would expect this identity
to hold, for any form f that evaluates cleanly:
(= (eval f) (eval (read-string (binding [*print-dup* true] (pr-str f)))))
I'm not sure if that's a reasonable assumption to make, but there are
at least a few cases for f where it doesn't hold:
'(/ 1.0 0) ; prints as "Infinity"
'(/ -1.0 0) ; prints as "-Infinity"
'(/ 0.0 0) ; prints as "NaN"
In REPLy, I'm currently monkey-patching clojure.core/print-method to
print these as "Double/POSITIVE_INFINITY", "Double/NEGATIVE_INFINITY",
"Double/NaN", respectively. I'm doing that due to some implementation
details (which actually may have recently been eliminated), but I'm
curious as to whether that round-trip seems desirable to others.
If so, I'd be happy to provide a patch.
- Colin
--
Colin Jones
@trptcolin