Fork me on GitHub
#clojure-dev
<
2019-06-12
>
mpenet06:06:22

@seancorfield you can set a print-method per reify instance, it's a bit hairy but it works

mpenet06:06:05

There could be an argument to allow to do that in the reify declaration as an improvement

mpenet06:06:31

you can just set a print-method for the type generated by reify

mpenet06:06:51

you might want to do it only once, not every time you use that reify tho

seancorfield06:06:53

My feeling right now is that this is purely to aid error handling and to give a hint in the REPL for misuse of an API so I don't think I need to ensure "printability" here. I just want to "guide" folks...

mpenet06:06:17

well you could hide the #object stuff and show whatever you want

seancorfield06:06:11

I don't want to enshrine behavior around the misuse -- just make it clearer what the person got wrong.

seancorfield06:06:54

If you do something that produces a Java object, you should get #object[...] in the REPL. That's the correct behavior.

mpenet06:06:26

oh ok, I misunderstood your issue

seancorfield06:06:53

NP. Seems to be the pattern of the day, getting misunderstood 🙂

seancorfield06:06:39

I'll be honest, my first reaction was "You misused the API, you get whatever the REPL says!" but that's perhaps less than helpful...

seancorfield06:06:38

I was actually surprised I could just slap toString into any reify and get that behavior... it was kind of a bonus!

enn19:06:36

Where would I look to find the design document which formerly lived at https://dev.clojure.org/display/design/Exception+handling+update (linked from CLJ-2373)?

andy.fingerhut19:06:08

Found via Google search terms: "exception handling update site:http://clojure.org". I knew Alex Miller had published a bunch of that stuff under a different URL, but forgot what it was.

andy.fingerhut19:06:31

Feel free to add another comment to that ticket with the updated link.

Alex Miller (Clojure team)20:06:21

I spent some time working on getting those to redirect but due to things like the + encoding, it's ... tedious

Alex Miller (Clojure team)20:06:02

ok, in lieu of making that actually work, I've made all the old design pages redirect to the home page of the archive. at least you'll be in the ballpark

enn20:06:24

Thank you!