Yes, your understanding is correct. MyCalcLambda is the one you'll want to
reify, and it will be just like using reify on any interface.

After that thread you linked to, I did create ike.cljj (
https://github.com/ike-tools/ike.cljj) which supports converting Clojure
functions to lambdas.

For a lot of use cases, it's probably better to stick with reify, but
ike.cljj can cut down on some of the boilerplate.

Andrew Oberstar

On Sat, Sep 19, 2015 at 8:20 PM Nagarajan N <oneto...@gmail.com> wrote:

> I started using clojure since last year. I like the language. It even made
> me more familiar with java. Before I detested java. Am moderately familiar
> with clojure way of making interop calls to java libraries. But I have no
> idea how to interop with a java library implementing java 8 lambdas as
> method params. I am not expecting any clean way to do this (I got that from
> this thread https://groups.google.com/forum/#!topic/clojure/WjTtqrLf_FY)
> . I just need a way (however verbose it is) to call a java method expecting
> a lambda.
> For example a java 8 code like this
>
>
> server.requestHandler(request -> {
>   request.response().end("hello world!");
> });
>
>
> how do I call this in clojure ,something like this
>
>
> (.requestHandler
>    server
>    (some-magical-function-or-macro
>      [request]
>      (doto request
>        (.response)
>        (.end "hello world!!"))))
>
>
> I 'd like someone to point me in the right direction for this.
>
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to