This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-17
Channels
- # beginners (26)
- # calva (7)
- # cider (6)
- # cljs-dev (7)
- # clojure (86)
- # clojure-europe (1)
- # clojure-finland (1)
- # clojure-spec (3)
- # clojure-uk (11)
- # clojurescript (18)
- # cursive (6)
- # data-science (1)
- # emacs (13)
- # fulcro (34)
- # juxt (8)
- # nrepl (6)
- # off-topic (11)
- # pathom (25)
- # re-frame (13)
- # reitit (11)
- # shadow-cljs (4)
- # spacemacs (3)
Occasionally (and for reasons unknown) I break paredit's "jail", creating unbalanced/missing delimiters. Then determining where the error is can be hard... e.g. the function is 20 LOC long, is the missing parens at the end? in the middle? wondering if there's an emacs (or clojure) function that will tell me "things begin to be broken at line x, column y"
@vemv Two hacks I've found helpful: - evaluating regions, so I can find where the problem isn't - using code-folding: folding a block that's malformed will often get a complaint from the editor about an unbalanced parenthesis
but i don't know about an auto function --- it might even be a harder-than-you'd-think problem, since it's about trying to read data for structure but the data is incorrectly structured
hacks noted, thanks! what do you use for code folding? I have some code-folding setup, but I currently don't know how to fold an arbitrary sexp
oh, and I use a LOT more do/comment blocks than I used to.... so it can be nice to make a do
block for what you're working on, slurp things into it, and evaluate the toplevel
when this happens, i go to the top of the file and start hitting paredit-forward
until i get a scan error
tried out. doesn't appear to help me point out the exact location
(example: place a stray (
in the middle of a defn
)
> it might even be a harder-than-you'd-think problem
sounds spot on. For example if I insert a stray (
in L50, it might pair with the nearest )
in L51, but things don't start to break until L70.
So how could an error reporter notice that something was off in L50 when in fact one can see a perfectly paired ( ...)
there? Sounds pretty hard without heuristics that try to understand the meaning of the code