clojure-dev

Issues: https://clojure.atlassian.net/browse/CLJ | Guide: https://insideclojure.org/2015/05/01/contributing-clojure/
seancorfield 2019-06-11T22:39:23.091500Z

If you end up printing the result of reify (because, say, you are misusing a value in the REPL), you get a fairly opaque #object[..] reference. It seems that you can implement toString in any reify call -- is that a reasonable option to provide a visible "hint" to the REPL user about what they did wrong?

seancorfield 2019-06-11T22:41:09.092200Z

(since Java objects were changed to print like that -- #object[..] -- I've seen quite a few people struggle to figure out what they might have done wrong if they end up with that in the REPL)

alexmiller 2019-06-11T22:41:49.092500Z

sure?

seancorfield 2019-06-11T22:49:30.094300Z

This came up again for me today because someone ran (next.jdbc/plan ...) in the REPL which produces an IReduceInit and they got

#object[next.jdbc.result_set$eval2218$fn$reify__2220 0x4fa3cd05 "next.jdbc.result_set$eval2218$fn$reify__2220@4fa3cd05"]
Which of course they did because it's a reify'd object 🙂 but the repeated string part in there is controlled by the toString implementation and can be changed into a hint about what might not have been done right...

seancorfield 2019-06-11T22:50:42.095Z

As long as no one thinks it's insane to add toString to override that and produce a hint/error message, I'll probably go that way. Curious if there are any obvious downsides to that...

2019-06-11T22:52:06.095600Z

changing the reify to a deftype or defrecord would result in a friendlier class name

seancorfield 2019-06-11T22:53:09.096100Z

True. But these are dynamically constructed, from anonymous functions, and close over a bunch of stuff.

bronsa 2019-06-11T23:14:06.096600Z

@alexmiller I'm stuck in a redirect loop when I try to login to atlassian, any ideas?

bronsa 2019-06-11T23:17:22.097100Z

looks like fifteenth time was the charm

😂 1
bronsa 2019-06-11T23:18:10.097900Z

all good

alexmiller 2019-06-11T23:18:25.098400Z

Sometimes there’s weirdness if the product access is wrong. I’m on phone but I’ll double check later