This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-18
Channels
- # aws (10)
- # beginners (43)
- # calva (1)
- # cider (7)
- # cljs-dev (83)
- # clojure (132)
- # clojure-dev (20)
- # clojure-europe (6)
- # clojure-greece (4)
- # clojure-italy (2)
- # clojure-nl (6)
- # clojure-spec (21)
- # clojure-sweden (16)
- # clojure-uk (21)
- # clojuredesign-podcast (16)
- # clojurescript (74)
- # cursive (41)
- # datomic (7)
- # emacs (3)
- # fulcro (30)
- # graalvm (3)
- # graphql (2)
- # instaparse (1)
- # jobs (1)
- # joker (13)
- # kaocha (14)
- # off-topic (118)
- # pathom (13)
- # re-frame (5)
- # reagent (22)
- # shadow-cljs (67)
- # spacemacs (7)
- # sydney (1)
- # testing (1)
- # tools-deps (82)
- # vim (4)
- # xtdb (1)
can I vote somewhere to make MultiFns more inspectable? Like making it's name
field public so I can write my own print-method for them that gives me hint what that function is
Can you back up to the problem you’re having and describe it?
The problem is I want to understand values at the repl. When I have fns in repl output, I can get some understanding of what values it refers to. For example, seeing "#object[clojure.core$inc 0x63bca84d \"clojure.core$inc@63bca84d\"]"
I know this is clojure.core/inc
. This is not the case for MultiFns, since they are displayed as "#object[clojure.lang.MultiFn 0x250a946 \"clojure.lang.MultiFn@250a946\"]"
without any hint to what they are about.
user=> (defmulti foo identity)
#'user/foo
user=> (defmethod foo 1 foo-one [x] (throw (Exception. "")))
#object[clojure.lang.MultiFn 0x32c8e539 "clojure.lang.MultiFn@32c8e539"]
user=> (foo 1)
Execution error at user/eval140$foo-one (REPL:1).
I mean I know, I can make name
field accessible using reflection and read it, but this feels brittle
and I would prefer to see it when I print it, not in an exception it throws: do I have to guess args to pass it so it throws?
there are some multimethod tickets out there, I'm not sure if this is one of them
right, I see -- maybe that's an enhancement request then, including the defmulti name in the multimethod toString
should I request it on http://ask.clojure.org?
that's probably the closest one I can see