On Sat, Jun 18, 2011 at 4:44 AM, Sam Aaron <samaa...@gmail.com> wrote:

> Is it possible to use this approach to create a callable record which can
> take a variable number of arguments?
>
> I can't get the following to work:
>
> (defrecord Foo [a]
>  clojure.lang.IFn
>  (invoke [this & args] (println (str a args))))
>
> (def yo (Foo. "sam"))
>
> (yo 1 2 3 4) ;=>
> sc-one.Foo.invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
>   [Thrown class java.lang.AbstractMethodError]
>
> Sam
>

defrecord/type methods don't support rest args.

David

-- 
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

Reply via email to