This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-12-10
Channels
- # adventofcode (68)
- # babashka (6)
- # babashka-sci-dev (3)
- # beginners (11)
- # biff (8)
- # circleci (13)
- # clj-kondo (1)
- # clojure (17)
- # clojure-europe (9)
- # clojurescript (12)
- # core-async (17)
- # cursive (9)
- # data-science (1)
- # datomic (3)
- # emacs (10)
- # fulcro (4)
- # off-topic (3)
- # practicalli (1)
- # releases (3)
- # sql (1)
- # xtdb (30)
Hi all,
Is there a way to automatically align case
, cond
or cond->
pairs like the pairs inside the let
's vector?
Thanks!
An alternative approach is to use line breaks between pairs:
(case x
1
"hello"
2
"goodbye")
That IMO looks ugly, but eh, formatting is always a matter of taste... 🙂 You can tell Cursive to (re)format specific symbols as something else, see https://cursive-ide.com/userguide/formatting.html Basically, you can tell Cursive to format case/cond/cond-> as let and it'll work the same.
@U052XLL3A yep, when the expression is too big I usually style using what you suggested, but it's not very common.
@U8SFC8HLP Have you found an expression to assign to style cond
and case
?
Since let
aligns the pairs inside the first argument (a vector), and case
's first parameter is a var, I'd like to style the rest arguments that aren't inside a vector and I haven't found an expression that performs that alignment.
@U02TF2JU3M4 I use commas to align