This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-10-06
Channels
- # aleph (15)
- # announcements (2)
- # babashka (121)
- # beginners (62)
- # biff (6)
- # cherry (2)
- # cider (51)
- # clerk (30)
- # cljs-dev (5)
- # clojure (77)
- # clojure-austin (2)
- # clojure-europe (10)
- # clojure-germany (6)
- # clojure-nl (1)
- # clojure-norway (19)
- # clojure-romania (1)
- # clojure-uk (3)
- # clojurescript (16)
- # core-typed (7)
- # cursive (17)
- # datomic (12)
- # deps-new (11)
- # emacs (7)
- # events (2)
- # fulcro (5)
- # honeysql (2)
- # hyperfiddle (32)
- # introduce-yourself (1)
- # jobs-discuss (2)
- # membrane (18)
- # missionary (2)
- # music (5)
- # polylith (7)
- # reagent (26)
- # releases (5)
- # testing (32)
- # tools-build (14)
- # tools-deps (7)
- # xtdb (8)
Where can I report a bug in cursive? Or is there a known bugs list I could look at first?
is that the same place?
> Takes an expression, and a set of clauses. > Each clause can take the form of either: > test-constant result-expr
Or perhaps a more focused one https://clojuredocs.org/clojure.core/case#example-61fc0a53e4b0b1e3652d75a6
no the semantics of case is that the matching forms can be a constant object to match or a list of constant objects to match. In my case I provide a singleton list of constant object(s). The code works correctly, and works as documented.
the code works as intended.
an important distinction between cond
and
case` is that cond
evaluates the forms to obtain a boolean, while case
does not evaluate the forms. so the static analizer should not consider a list in this position as a function call, but rather as list of constants.
Interesting! The https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L6779 say: "The test-constants are not evaluated. They must be compile-time literals, and need not be quoted" So this works:
(let [x 'foo]
(case x
(foo) :yo))
But reading the "need not be quoted" part, I would have expected this to work as well:
(let [x 'foo]
(case x
('foo) :yo))
but that gives me No matching clause: foo
@U052XLL3A That’s because reader macros are expanded, but the resulting form is then not evaluated. So you’re trying to match on ((quote foo))
there. If you pass '(quote foo)
as x
that will work.