multimethod
Scheme -> Clojure: multimethods with predicates in the methods?
I\'m converting some Scheme code to Clojure. The original uses a dispatching pattern that\'s very similar to multimethods, but with an inverted approach to the matching predicates.For example, there a[详细]
2023-04-10 04:08 分类:问答Looping through args of macro
I am trying to write a macro in Clojure that allows for evaluation of a series of simple \"def\" expressions. I am a n00b when it comes to macros. The idea is that[详细]
2023-04-02 08:58 分类:问答Clojure multimethod on class OR keyword
Suppose I have this multimethod (defmulti m (fn [v] [(:type v)])) (defmethod m [Object] [k] (prn \"Object\"))[详细]
2023-02-19 20:39 分类:问答Is a self-recursive clojure multimethod a good design for a nested classification problem?
I have a large sequence of data-maps and each map needs to be classified in a nested fashion. i.e. a given item may be an A or a B (as determined by a function), if it is a B then it may be a C or a[详细]
2023-02-14 00:42 分类:问答Any good multimethod implementation for Java?
I am wondering if there is any reasonably good multimethod implemen开发者_如何学Ctation/library for Java like Lisp has.[详细]
2023-02-12 04:36 分类:问答Can I use Clojure multimethods only on Java classes?
I am a bit confused about whether I can only use clojure multimethods on clojure structures represented by Java classes, or can I base mu开发者_JAVA技巧ltimethods to dispatch on structs or other prope[详细]
2023-02-02 15:03 分类:问答Can I use Clojure's derive to create a hierarchy of my defrecord class types?
I would l开发者_StackOverflowike to do something like: (defrecord Base []) (defrecord Person []) (defrecord Animal [])[详细]
2023-02-02 00:33 分类:问答Multiple dispatch and multi-methods
What are they, what\'s the different between them? Many sources, l开发者_StackOverflowike Wikipedia, claim they\'re the same thing, but others explicitly say the opposite, like sbi in this question:[详细]
2023-01-28 19:41 分类:问答Defining Clojure multimethods
I have 开发者_如何学Cthe following in one namespace say shapes: (derive ::rect ::shape) (derive ::square ::rect)[详细]
2023-01-03 16:13 分类:问答