This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-09
Channels
- # announcements (4)
- # babashka (25)
- # beginners (11)
- # calva (32)
- # clj-kondo (5)
- # clojure (130)
- # clojure-dev (11)
- # clojure-europe (17)
- # clojure-nl (1)
- # clojure-norway (96)
- # clojure-spec (1)
- # clojure-uk (3)
- # clojurescript (9)
- # conjure (2)
- # cursive (8)
- # datalevin (1)
- # etaoin (14)
- # ghostwheel (2)
- # hyperfiddle (13)
- # joker (2)
- # leiningen (82)
- # malli (3)
- # pathom (4)
- # polylith (12)
- # releases (3)
- # spacemacs (7)
- # sql (3)
In the release notes for Alpha 6, there's a Functional Interfaces section where it says "Note: this will be available in a future alpha." but the Java Supplier Interop subsection did make it into Alpha 6. Curious about why the FI stuff got documented but didn't make the alpha, and whether there's a timeline in mind for it to make a future alpha?
it's part of the story, so felt weird to leave it out, but the work needs to be rebased over the method values stuff. hopefully will be in the next alpha
Cool. But no timeline for that yet?
Haha... it was worth a try... 🙂
"soon" I hope :)
In the description for https://clojure.atlassian.net/browse/CLJ-2805, it says:
> Type hints can be any type hint specification currently accepted -- fully-qualified class symbols, imported short class symbols, or “special” type hints representing primitives (like ^long
, double
, etc.) or arrays (like ^longs
, ^objects
, etc.), or strings.
Does this mean that e.g. ^{:param-tags [^long]} MyClass/myMethod
should work? i.e. with the ^
in ^long
?
That looks like it should be a read error to me, but the description is a little ambiguous.
Clojure 1.12 Alpha 7 rejects that:
user=> (^{:param-tags [^String]} java.net.URI/new "")
Syntax error reading source at (REPL:2:25).
Unmatched delimiter: ]
Syntax error reading source at (REPL:2:26).
Unmatched delimiter: }
Syntax error (IllegalArgumentException) compiling at (REPL:0:0).
Multiple matches for constructor in class java.net.URI, use param-tags to specify
""
Syntax error reading source at (REPL:2:63).
Unmatched delimiter: )
user=> (^{:param-tags [String]} java.net.URI/new "")
#object[java.net.URI 0x51dbd6e4 ""]
user=> (^[String] java.net.URI/new "")
#object[java.net.URI 0x5f303ecd ""]
user=> (^[^String] java.net.URI/new "")
Syntax error reading source at (REPL:5:12).
Unmatched delimiter: ]
Syntax error (IllegalArgumentException) compiling at (REPL:0:0).
Multiple matches for constructor in class java.net.URI, use param-tags to specify
""
Syntax error reading source at (REPL:5:49).
Unmatched delimiter: )
user=>
Just long