Fork me on GitHub
#beginners
<
2020-08-08
>
Jim Newton09:08:14

Can someone help me understand this error message? Why is it complaining about java.util.concurrent.Future ?

clojure-rte.bdd-test> (def ^:dynamic *xyzzy* false)
#'clojure-rte.bdd-test/*xyzzy*
clojure-rte.bdd-test> (map? @*xyzzy*)
Execution error (ClassCastException) at clojure-rte.bdd-test/eval15290 (form-init5713417271367683958.clj:26770).
class java.lang.Boolean cannot be cast to class java.util.concurrent.Future (java.lang.Boolean and java.util.concurrent.Future are in module java.base of loader 'bootstrap')
clojure-rte.bdd-test> 

Jim Newton12:08:14

is there a %something I can use in (format ...) which will cause the object to be printed with print-method rather than printing with its default print?

(defmethod print-method Bdd [bdd w]
  (.write w (format "#<Bdd %s %s %s>" (:label bdd) (:positive bdd) (:negative bdd))))
this is my print-method but when (:positive bdd) is another object of the same type, it prints as #<Bdd Short true [email protected]> rather than making a recursive call to print-method

Jim Newton15:08:04

what is the correct way to determine whether two values are the same object as opposed to simply being = ? I found the function eq but it has https://clojuredocs.org/clojure.core.logic.fd/eq.

dpsutton15:08:01

(doc identical?)

👍 1
Jim Newton15:08:20

Thanks.

👍 1
Dimitar Uzunov21:08:28

What are the best practices on doing a docker build or equivalent with tool-deps? Should I create a jar and run it in the container?

seancorfield22:08:29

@dimitar.ouzounoff Overall, I think I've seen most folks end up going with an AOT'd "uber" JAR file run inside Docker via java -jar.

seancorfield22:08:24

I think that gives you the fewest moving parts and the most "standard" approach.