I'm working on an object system called Fenrir, and one of the
functions in my library, called new-obj, is used to make instances of
classes:

(defmulti new-obj #(:_fenrir_class-name %))
(defmethod new-obj ::fObject [fclass & kvals]
        (with-meta (apply struct-map (conj kvals (:_fenrir_struct fclass)))
                {:_fenrir_class (:_fenrir_class-name fclass)}))

In fObject, the class which all other classes extend, I have
implemented the basic mechanisms for setting slots in struct-objects.
However, when I call the multimethod with something like this:

(new-obj fGameObject :location 'a-loc :sprite 'a-sprite)

I get this error:

1:14 yggdrasil.fenrir.core=> java.lang.IllegalArgumentException: Wrong
number of args passed to: core$fn (repl-1:13)

That sort of thing has also happened to me with other multimethods I'm
working on.

Could anybody help me?

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to