> > > For instance, which one of these to you consider to be the best > representation of a event to set the expiry time: > > [:cache/expire #inst "2015-09-08T12:00:00Z"] > > {:type :cache/expire, :value #inst "2015-09-08T12:00:00Z"} > > #cache.Expire [#inst "2015-09-08T12:00:00Z"] > > #cache.Expire {:value #inst "2015-09-08T12:00:00Z"} >
None of those, well the {:type ... :value ...} one is closest. I tried to stay away from the Type/Variant discussion since I'm not familiar enough with all the theory behind it and generally like to be more practical. Also there isn't enough context in your question to give an acceptable answer. Generally I'd have something like (set-expiration-time thing time) but since you said "event" I assume you have some kind of messaging system. So I'd abstract the usual message patterns and use a message "envelope". (defrecord Message [type payload]) type would probably be a Keyword and payload probably Any. So to write it as edn: #my.app/message [:cache/expire #inst "2015-09-08T12:00:00Z"] #my.app/message {:type :cache/expire, :payload ...} Note that this is ONLY the representation on-the-wire which you generally want to be compact as possible, so I'd choose the vector variant since it is more compact and doesn't encode the keys. What I get when I "read" this data is not tied to the data format used on the wire though, don't mix those up. The wire-format has totally different requirements than your code. /thomas -- 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.