Very nice. Much better than the past 2 hours I spent writing a simpler version of Throwable w/ data, i.e.:
(ns MyError (:gen-class :extends java.lang.Throwable :state state :init init :constructors {[Object] []})) (defn -init [obj] [[] obj]) Thanks! On Mon, Jan 20, 2014 at 3:41 AM, Herwig Hochleitner <hhochleit...@gmail.com>wrote: > Maybe your needs are met by the now builtin ex-info and ex-data. They work > the same in clj and cljs: > > (try (throw (ex-info "msg" {:data "map"})) > (catch :default e > (ex-data e))) > > kind regards > > > 2014/1/20 t x <txrev...@gmail.com> > >> Hi, >> >> ## Basic Question >> >> Is there a library that: >> (1) is like slingshot.slingshot and >> (2) has the same syntax + semantics in both clj and cljs ? >> >> ## Situation I'm stuck in: >> >> * I'm writing code in cljx. Thus, as much as possible, I'd prefer code >> that simultaneously work with both clj and cljs >> >> * I want to throw arbitrary data. Thus, I'm using slingshot. >> >> * I don't know how to get slingshot to have same semantics in cljs land. >> >> Thanks in advance for any pointers. >> >> -- >> -- >> 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/groups/opt_out. >> > > -- > -- > 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/groups/opt_out. > -- -- 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/groups/opt_out.