Fork me on GitHub
#clojure
<
2024-03-29
>
roklenarcic10:03:18

Is it possible to typehint return type or arguments for protocol functions?

p-himik10:03:44

Yes, should work just like with regular functions.

Alex Miller (Clojure team)12:03:44

The return type hint goes in a different place - before the protocol name instead of before the param vector

p-himik12:03:10

Oh, huh. I saw such instances, but I thought it was the mistake that people make with regular functions. Are there any downsides in making it also accept the (supports? ^boolean [this next]) syntax in Clojure?

roklenarcic12:03:01

Ah, this is embarrassing but I think I put the hint before function name on normal functions on occasions

Alex Miller (Clojure team)13:03:33

In that case you are hinting the var, which does still work (except for long or double primitive type hints)

roklenarcic13:03:07

Well, I learned something I guess 🙂

dgr15:03:03

Did the changes.md file get updated for Clojure 1.11.2 that released earlier this month? On this page, https://clojure.org/releases/downloads, it links to the changes.md file on GitHub, but that file seems to have been last touched for Clojure 1.11.1, on April 1, 2022.

seancorfield16:03:58

I think @U064X3EF3 mentioned that updating the change log for 1.11.2 was on his todo list but it hasn't happened yet?

Alex Miller (Clojure team)16:03:22

Yeah, I’ll get it when we update for 1.12

dgr16:03:02

Thanks, no worries. Just wanted to make sure that it wasn’t me. I’ll just browse the commits for now.

seancorfield16:03:40

I think the only change between 1.11.1 and 1.11.2 is the fix for the CVE (which is listed in 1.12 Alpha 9 change log notes).

👍 1
Alex Miller (Clojure team)17:03:14

It was intended to be a very small and safe change for upgrade