Simply use the alternative dot-form:

(. (java.util.Date.) getDate)
(. record value)

On Mon, Jul 16, 2012 at 9:42 PM, john <john.vie...@gmail.com> wrote:
> Hello,
> I have for example:
>
> (defrecord record [^long value])
>
> (def aRecord (record. 123))
>
> ; Now I want to construct code like (.value aRecord)
> ; with a macro
>
> I tried
>
> (defmacro inline-first-method[]
>   (let [methods (record/getBasis)]
>     (list '. (first methods) aRecord )))
> ;but
> (macroexpand-1 '(inline-first-method))
> ;yields (. value aRecord) which does not work.
>
> I know I could use (keyword (first methods)) but
> for performance reasons I want to use the . operator on the record
>
> Many Greetings
> John
>
>
>
> --
> 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

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