invoke macro in the Indirection section

38 views
Skip to first unread message

Michael O'Keefe

unread,
Nov 9, 2017, 9:04:00 AM11/9/17
to Elements of Clojure
Loving the book so far! Thank you for writing it.

In the chapter on Indirection, there is a macro for invoke. Question: shouldn't that macro pass the object x as an argument to the method implementation?

Perhaps something like:

(defmacro invoke
 
[class->method->impl x method & args]
 
`((get-in ~class->method->impl [(class ~x) ~method])
    ~x ~@args))


Where the second to last element (before ~@args) is the new part?

Sincerely,

Michael O'Keefe

Zach Tellman

unread,
Nov 9, 2017, 12:43:36 PM11/9/17
to Michael O'Keefe, Elements of Clojure
Yes, it should. That was an oversight on my part, thank you for catching it.
--
You received this message because you are subscribed to the Google Groups "Elements of Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elements-of-clo...@googlegroups.com.
To post to this group, send email to elements-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elements-of-clojure/6de86d14-4932-452c-ae6d-81c2a76da3fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages