What's your `print-dup` for instants print them as?  The way compilation 
for these expressions is going to work is:

(a) The initial form will be read using the configured *data-readers*, 
handing the compiler a form with a literal instance object.
(b) The compiler will generate code to create that literal; when the 
literal value isn't of a type the compiler knows how to emit directly, it 
emits code to round-trip back through the reader at run-time, embedding the 
`print-dup` representation of the object as a string.

If `print-dup` prints in such a way as to discard the offset, away it goes.

-Marshall

On Wednesday, August 20, 2014 10:29:15 AM UTC-4, dan.sto...@gmail.com wrote:
>
> Maybe I am missing something obvious - 
>
> I am using custom data readers for joda-time instants. time/inst strings 
> are coerced into utc date times, time/insto keep the offset around. 
>
> Using the exact same function to parse the string via the data-reader, and 
> just calling the function - I get different results. The function is 
> pure... 
>
> *data-readers*
> => {time/insto (var corp-pure.time/parse-with-offset), 
>       time/inst (var corp-pure.time/parse)}
>
> (.getChronology (corp-pure-time/parse-with-offset 
> "2014-05-03T23:00:00+0100"))
> (.getChronology #time/insto "2014-05-03T23:00:00+0100")
>
> => #<ISOChronology ISOChronology[+01:00]>
> => #<ISOChronology ISOChronology[UTC]>
>
> To prove there are no obvious side-effects here:
>
> (.getChronology (corp-pure.time/parse-with-offset 
> "2014-05-03T23:00:00+0100"))
> (.getChronology (corp-pure.time/parse-with-offset 
> "2014-05-03T23:00:00+0100"))
>
> => #<ISOChronology ISOChronology[+01:00]>
> => #<ISOChronology ISOChronology[+01:00]>
>
> (.getChronology #time/insto "2014-05-03T23:00:00+0100")
> (.getChronology #time/insto "2014-05-03T23:00:00+0100")
>
> => #<ISOChronology ISOChronology[UTC]>
> => #<ISOChronology ISOChronology[UTC]>
>
> Has anyone seen anything like this?
>

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