This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-20
Channels
- # aleph (4)
- # beginners (47)
- # boot (22)
- # cider (7)
- # clara (1)
- # cljs-dev (8)
- # cljsrn (21)
- # clojure (180)
- # clojure-argentina (13)
- # clojure-gamedev (1)
- # clojure-italy (5)
- # clojure-poland (4)
- # clojure-russia (17)
- # clojure-spec (19)
- # clojure-uk (33)
- # clojurescript (107)
- # cursive (61)
- # data-science (1)
- # datomic (7)
- # emacs (69)
- # euroclojure (1)
- # graphql (1)
- # hoplon (11)
- # immutant (43)
- # jobs (1)
- # leiningen (3)
- # off-topic (5)
- # om (10)
- # onyx (2)
- # parinfer (52)
- # pedestal (11)
- # re-frame (31)
- # reagent (23)
- # ring-swagger (3)
- # schema (2)
- # specter (7)
- # unrepl (9)
ciao a tutti. Dubbi con defprotocol
, deftype
e extend-type
.
Ho un protocollo P così definito:
(defprotocol P
(f [this])
ho bisogno di applicare f
di P
a tipi "base" (es. String) e a tipi custom creati ad hoc con deftype
. Qual è la strada migliore? Il dispatch a runtime funziona per tipo, ma ho bisogno di distinguere quando chiamare f
e .f
a seconda se sono su tipo base (esteso con extend-type
) o tipo custom (creato con deftype
).
Ammetto che il mio background Java mi spinge sempre verso l'OO, sorry. 🙂