This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-07-31
Channels
- # announcements (6)
- # babashka (4)
- # beginners (24)
- # cider (10)
- # clj-kondo (5)
- # clojure (119)
- # clojure-europe (48)
- # clojure-norway (32)
- # clojure-uk (2)
- # cursive (13)
- # datahike (3)
- # datomic (5)
- # eastwood (3)
- # emacs (3)
- # gratitude (4)
- # hyperfiddle (62)
- # malli (11)
- # off-topic (65)
- # polylith (12)
- # portal (2)
- # releases (2)
(defn fibo-iter
([n] (fibo-iter 0 1 n))
([curr nxt n]
(cond
(zero? n) curr
:else (recur nxt (+ curr nxt) (dec n)))))
;;=> #'user/fibo-iter
(schema.core/defn fibo-iter-with-schema
([n :- schema.core/Int] (fibo-iter 0 1 n))
([curr :- schema.core/Int
nxt :- schema.core/Int
n :- schema.core/Int]
(cond
(zero? n) curr
:else (recur nxt (+ curr nxt) (dec n)))))
;;=> #'user/fibo-iter-with-schema
(fibo-iter 10)
;;=> 55
(fibo-iter-with-schema 10)
;;=> 55
I see cider debbugger doesn't work with schema.core/defn
.
Any ideas to make it work well?
cider doc: https://docs.cider.mx/cider/debugging/debugger.html
schema.core: https://github.com/plumatic/schemait does work for me. What problem are you seeing? What I see is in your example fibo-iter-with-schema is calling fibo-iter instead of itself so the second signature never runs
sorry poor screen cast, this is what I see. (calling fibo-iter in fibo-iter-with-schema issue is fixed, sorry for confusing)
I was able to reproduce, can you try hitting n
instead of c
when the debugger first pops up
I'm not sure why it is even popping up there, looks like the macro expansion is calling the fn :thinking_face:
that is weird, looks like a bug to me, I guess we should create an issue