This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-22
Channels
- # announcements (7)
- # babashka (17)
- # beginners (45)
- # biff (2)
- # cider (16)
- # clj-on-windows (3)
- # cljs-dev (12)
- # clojure (27)
- # clojure-austin (1)
- # clojure-europe (18)
- # clojure-norway (5)
- # clojurescript (36)
- # conjure (35)
- # core-async (2)
- # datascript (4)
- # datomic (4)
- # emacs (15)
- # fulcro (23)
- # holy-lambda (12)
- # hyperfiddle (1)
- # introduce-yourself (5)
- # nbb (11)
- # off-topic (37)
- # pathom (34)
- # pedestal (9)
- # reitit (4)
- # releases (1)
- # remote-jobs (1)
- # sci (5)
- # scittle (3)
- # shadow-cljs (88)
- # tools-build (4)
Can someone please tell me how #_
reader macro is implemented? Searching through http://github.com/clojure/clojure, I can't seem to find it.
Oh wow. There's more stuff in there.
http://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L109-L120
what are CommentReader
, EvalReader
and UnreadableReader
are for? Do we have things like #!
, #=
and #<
?
I don't understand how the spec error can be so clear and yet i don't see the same thing. What i see is that the :refere-clojure is correctly using :exlude (first code block) but the spec error (second block) is very clear that it think it's an ":as" could the way i got to the library be not taking me to the real code? I just hovered over the import in my app and did a lsp-find-defination.
(ns clojure.core.async
"Facilities for async programming and communication.
go blocks are dispatched over an internal thread pool, which
defaults to 8 threads. The size of this pool can be modified using
the Java system property `clojure.core.async.pool-size`."
(:refer-clojure :exclude [reduce transduce into merge map take partition ;; <--------------- looks fine to me
partition-by bounded-count])
(:require [clojure.core.async.impl.protocols :as impl]
[clojure.core.async.impl.channels :as channels]
[clojure.core.async.impl.buffers :as buffers]
[clojure.core.async.impl.timers :as timers]
[clojure.core.async.impl.dispatch :as dispatch]
[clojure.core.async.impl.ioc-macros :as ioc]
[clojure.core.async.impl.mutex :as mutex]
[clojure.core.async.impl.concurrent :as conc]
)
(:import [java.util.concurrent.locks Lock]
[java.util.concurrent Executors Executor ThreadLocalRandom]
[java.util ArrayList]))
aused by: clojure.lang.ExceptionInfo: Call to clojure.core/refer-clojure did not conform to spec:
-- Spec failed --------------------
(... ... ':as ...)
^^^^
should be one of: :exclude, :only, :rename
-- Spec failed --------------------
(... ... (... :as) ...)
^^^
should be one of: :exclude, :only, :rename
-------------------------
Detected 2 errors
{:clojure.spec.alpha/problems ({:path [:args :exclude :op :spec], :pred #{:exclude}, :val (quote :as), :via [], :in [2]} {:path [:args :exclude :op :quoted-spec :spec], :pred #{:exclude}, :val :as, :via [], :in [2 1]} {:path [:args :only :op :spec], :pred #{:only}, :val (quote :as), :via [], :in [2]} {:path [:args :only :op :quoted-spec :spec], :pred #{:only}, :val :as, :via [], :in [2 1]} {:path [:args :rename :op :spec], :pred #{:rename}, :val (quote :as), :via [], :in [2]} {:path [:args :rename :op :quoted-spec :spec], :pred #{:rename}, :val :as, :via [], :in [2 1]}), :clojure.spec.alpha/spec #object[clojure.spec.alpha$regex_spec_impl$reify__2436 0x1cb9ef52 "clojure.spec.alpha$regex_spec_impl$reify__2436@1cb9ef52"], :clojure.spec.alpha/value ((quote :exclude) (quote [reduce transduce into merge map take partition partition-by bounded-count]) (quote :as) (quote core)), :clojure.spec.alpha/args ((quote :exclude) (quote [reduce transduce into merge map take partition partition-by bounded-count]) (quote :as) (quote core))}
I mean, i imagine the solution to my problem is to just update core async. But i'm going to have to do a lot of these updates and so i would like to be more sure of how to get feedback.
seems like the value is (:refer-clojure :exclude [reduce transduce into merge map take partition partition-by bounded-count] :as core)
. the problem the :as core
bit
interesting. so lsp did take me to another place. it was some cache.
workshop/.cache/clojure.core.async.clj vs if i use cider-find-var i get core.async-0.2.395.jar:clojure/core/async.clj
2f87bc7c7d10cb7b0baafc86e08489d58fa87424
Author: Alex Miller <[email protected]>
AuthorDate: Tue Mar 14 12:17:56 2017 -0500
Commit: Alex Miller <[email protected]>
CommitDate: Tue Mar 14 12:17:56 2017 -0500
Parent: d17eb8a [maven-release-plugin] prepare for next development iteration
Contained: master
Follows: core.async-0.3.441 (2)
Precedes: core.async-0.3.442 (2)
Fix bad :refer-clojure that fails with new refer-clojure spec (see CLJ-2062)
1 file changed, 1 insertion(+), 1 deletion(-)
src/main/clojure/clojure/core/async.clj | 2 +-
modified src/main/clojure/clojure/core/async.clj
@@ -13,7 +13,7 @@ go blocks are dispatched over an internal thread pool, which
defaults to 8 threads. The size of this pool can be modified using
the Java system property `clojure.core.async.pool-size`."
(:refer-clojure :exclude [reduce transduce into merge map take partition
- partition-by bounded-count] :as core)
+ partition-by bounded-count])
(:require [clojure.core.async.impl.protocols :as impl]
[clojure.core.async.impl.channels :as channels]
[clojure.core.async.impl.buffers :as buffers]
Thanks. ok. that all makes sense.