This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-17
Channels
- # announcements (3)
- # babashka (41)
- # beginners (118)
- # calva (4)
- # cider (22)
- # clj-kondo (4)
- # clj-on-windows (1)
- # clj-together (1)
- # clojure (164)
- # clojure-europe (46)
- # clojure-filipino (1)
- # clojure-indonesia (1)
- # clojure-my (1)
- # clojure-nl (3)
- # clojure-sg (1)
- # clojure-spec (13)
- # clojure-uk (16)
- # clojurescript (18)
- # cloverage (3)
- # conjure (5)
- # core-async (8)
- # cursive (21)
- # datomic (4)
- # deps-new (15)
- # emacs (12)
- # expound (4)
- # fulcro (45)
- # graalvm (32)
- # jobs (1)
- # malli (5)
- # nextjournal (63)
- # off-topic (27)
- # other-languages (3)
- # pathom (27)
- # proletarian (1)
- # rdf (24)
- # re-frame (10)
- # reagent (9)
- # releases (2)
- # shadow-cljs (72)
- # spacemacs (4)
- # timbre (4)
- # tools-deps (29)
- # xtdb (4)
same with conj
even shorter is min
or max
if macros are allowed, then I think or
is the shortest
otherwise, I think the shortest is 3 characters using min
or max
Well, I suppose (def i identity)
and then (i ...whatever...)
would amortize very fast (if we discount the keystrokes expended in this discussion 馃榿 ).
it's silly to complain about, but I do wish identity
, partial
and complement
had shorter names
user=> (require '[clojure.core :refer [identity comp partial] :rename {identity id comp 路 partial $}])
nil
user=> (map id [1 2 3 4])
(1 2 3 4)
user=> ((路 ($ apply str) reverse str) "Hello, world!")
"!dlrow ,olleH"
Just to expand on what Alex said. 馃檪So... would one consider this as code duplication if the names are long? 馃槃
I'm aware you can do that, but you'd have to do it everywhere (or use hacks like Leiningen injections). Not worth the effort, which is why defaults are important
you can give them any shorter name you like :)
Just don鈥檛 ask ME to maintain your code if you do 馃槈
seriously though, given their frequency of use, I think it's ok that these are longer
If you just want to have them not display as long, you can setup your editor to show whatever text you want as a substitution. e.g.