Morning
Is it expected that satisfies?
returns false for vals extending the protocol with metadata?
Case in point:
(defprotocol A :extend-via-metadata true (a [this]))
(satisfies? A (with-meta {} {`a identity})) ;; => false
but as expected:
(a (with-meta {} {`a identity})) ;; => {}
Shouldn’t the protocol opt-in to extension via metadata?
@orestis you're right, my example misses that, fixed
seem to cover it
so it's considered as a fix
satisfies? is also quite slow
(for now)
there's a separate ticket for that
on the downside, fixing CLJ-2426 will only hurt perf more
did you consider leaving the behavior of satisfies?
as is and have a separate predicate for extended vals, like val-satisfies?
which would be the slow, all encompassing version (checks any val, record included).
quick question: is the syntax #^
for meta data deprecated ? I only found this commit for v1.2
to allow ^
for metadata but unfortunately the changes.md
file goes up until v1.3
😅
https://github.com/clojure/clojure/commit/a5ca8243e3ea45e6387b2b00d0e9b2624d16adbf
#^
is a deprecated synonym of ^
so this is “official” ? because I couldnt find anything stating it 😕
a long time ago ^
used to mean read-time meta
and #^
was the way to do read time with-meta
^
is the "preferred" way to do it now, but #^
is never going away or change
it's deprecated in the sense that ^
is equivalent and preferred to it
There's some uses in the clojure source code still
:thumbsup::skin-tone-4:
thanks a lot for the info
https://github.com/clojure/clojure-site/blob/7493bdb10222719923519bfd6d2699a26677ee82/content/guides/weird_characters.adoc#L309 somewhat documented here
(says the same thing as @bronsa )
@bronsa are there any cases where #^
supports more than ^
?
at one point I thought there was something
like in the odder cases where you hint a string :tag
or something?
no they're literally the same
you're thinking of something else
^^ they both just invoke the MetaReader
I think some developers may have become accustomed to the idea that "deprecated" means "will likely go away in a future version" ? That does not seem to apply to Clojure, and not very often to Java.