Hello,
On 14 Okt., 16:58, Randall R Schulz <[EMAIL PROTECTED]> wrote:
> I have heard it claimed (on one of the Scala lists, I think)
> that patterns themselves are an anti-pattern...
I think there are always patterns. They are just different. In
Clojure there is maybe the "Driver Function" patte
That's a very elegant solution Rich. I'm so obvious when someone tells
you how to do it.
Clojure amazes me more every day. All the painfully accumulated
knowledge of Java design patterns are so trivial in Clojure. It
doesn't even seem like there's any need for design "patterns" at all
anymore cau
On Tuesday 14 October 2008 07:48, CuppoJava wrote:
> That's a very elegant solution Rich. I'm so obvious when someone
> tells you how to do it.
>
> Clojure amazes me more every day. All the painfully accumulated
> knowledge of Java design patterns are so trivial in Clojure. It
> doesn't even seem
On Mon, Oct 13, 2008 at 11:14 PM, Stuart Halloway
<[EMAIL PROTECTED]> wrote:
>
> Hi Patrick,
>
> How about:
>
> (defmulti length (fn [x]
> (if (= :stateMachine (:class x))
>(:state x)
>(:class x
>
> (defmethod length :yardstick [x] 36)
On Oct 13, 11:01 pm, CuppoJava <[EMAIL PROTECTED]> wrote:
> Is there anyway to do the following with the existing multi-method
> facilities?
>
> There is a general multi-method length(object) that splits off to
> different methods depending on the :class of the object.
>
> And then specifically
Hi Patrick,
How about:
(defmulti length (fn [x]
(if (= :stateMachine (:class x))
(:state x)
(:class x
(defmethod length :yardstick [x] 36)
(defmethod length :walking [x] "short")
(defmethod length :running [x] "long")
user=> (lengt