This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-23
Channels
- # admin-announcements (1)
- # arachne (3)
- # aws (1)
- # bangalore-clj (2)
- # beginners (209)
- # boot (81)
- # capetown (2)
- # cider (16)
- # clara (13)
- # cljsjs (16)
- # cljsrn (6)
- # clojure (217)
- # clojure-czech (1)
- # clojure-greece (4)
- # clojure-italy (3)
- # clojure-korea (3)
- # clojure-russia (3)
- # clojure-sg (3)
- # clojure-spec (104)
- # clojure-uk (23)
- # clojurescript (7)
- # component (7)
- # cursive (18)
- # datomic (12)
- # devcards (34)
- # dirac (17)
- # editors (3)
- # emacs (1)
- # events (1)
- # hoplon (62)
- # immutant (12)
- # incanter (1)
- # jobs (1)
- # klipse (2)
- # ldnclj (1)
- # luminus (1)
- # mount (1)
- # off-topic (8)
- # om (50)
- # onyx (46)
- # parinfer (5)
- # pedestal (4)
- # perun (2)
- # reagent (1)
- # rum (1)
- # schema (5)
- # specter (30)
- # untangled (5)
- # vim (46)
Is there a way I can debug this reduce code :
((fn [s] (reduce (fn[acc n] (if (not= n (last acc)) (conj acc n))) [(first s)] s )) [1 1 2 ])
Im expecting that acc is a vector but when I use conj the new entries are placed at front instead of at the end
((fn [s] (reductions (fn[acc n] (if (not= n (last acc)) (conj acc n))) [(first s)] s )) [1 1 2 ]) => ([1] nil (1) (2 1))
If you still want to learn how to debug: Break up the function into multiple lines, then set a breakpoint, and then start the debugger with cursive (in the cursive docs)
Yes I see, that'll safe you this time, but it might be better for you to learn the debugger for future problems
Debuggers shouldn’t be line based with a language such as Clojure.
@roelofw Or try Sayid for tracing everything: http://bpiel.github.io/sayid/
@yonatanel Thanks for the tip
@pupeno I remember NetBeans having expression based debugging for about a decade, maybe JetBrains should start to think about it as well
@katox really? I never seen an expression based debugger before and I’ve been telling people that’s how it should work for a decade or so… well… since I started playing with Lisps, were lines are not that meaningful. JetBrains tend to be very responsive, so, we should probably ask. But I’d like to as @cfleming if IntelliJ IDEA support is necessary or is it just a Cursive thing.