[jruby-user] Re: java interoperation; lambda to callbacks?

Peter Lauck <[email protected]> Sat, 23 May 2015 10:55:55 -0400
Newsgroups gmane.comp.lang.jruby.user
Message-ID <CAJLVirUjfVgy4usZ-=tCF4RND+B=CD4ZkotnnmzPywgKrk5LNQ@mail.gmail.com>
--001a11354a0048606d0516c0f925
Content-Type: text/plain; charset=UTF-8

Well the method works with a lambda so I assume either jruby or jrubyfx is
handling that conversion.

- Peter Lauck

On Fri, May 22, 2015 at 1:52 PM, Peter Lauck <[email protected]> wrote:

> col.setCellValueFactory( cellData -> cellData.getValue())
>
> Would this code be equivalent to writing the jruby code:
>
> col.set_cell_value_factory( lambda { |data| data.get_value  } )
>
> Will jruby do the correct conversion? Perhaps I should use Proc instead of
> lambda?
>
> Thanks in advance for the help
>
> P.S. Sorry about splitting this up into 2 emails
>
> - Peter Lauck
>
> On Fri, May 22, 2015 at 1:44 PM, Peter Lauck <[email protected]> wrote:
>
>> Hey I have a quick question. Will jruby convert my lambdas to java
>> callbacks? To be more specific, I'm working with JavaFX (with JRubyFX) and
>> I have a method setCellValueFactory() that expects takes a java Callback as
>> a parameter. Since Java 8 added lambdas, the java code might be something
>> like this:
>> - Peter Lauck
>>
>
>

--001a11354a0048606d0516c0f925
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Well the method works with a lambda so I assume either jru=
by or jrubyfx is handling that conversion.</div><div class=3D"gmail_extra">=
<br clear=3D"all"><div><div class=3D"gmail_signature"><div dir=3D"ltr">- Pe=
ter Lauck</div></div></div>
<br><div class=3D"gmail_quote">On Fri, May 22, 2015 at 1:52 PM, Peter Lauck=
 <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" target=3D"_bl=
ank">[email protected]</a>&gt;</span> wrote:<br><blockquote class=3D"gmai=
l_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left=
:1ex"><div dir=3D"ltr">col.setCellValueFactory( cellData -&gt; cellData.get=
Value())<div><br></div><div>Would this code be equivalent to writing the jr=
uby code:</div><div><br></div><div>col.set_cell_value_factory( lambda { |da=
ta| data.get_value =C2=A0} )</div><div><br></div><div>Will jruby do the cor=
rect conversion? Perhaps I should use Proc instead of lambda?</div><div><br=
></div><div>Thanks in advance for the help</div><div><br></div><div>P.S. So=
rry about splitting this up into 2 emails</div></div><div class=3D"gmail_ex=
tra"><br clear=3D"all"><div><div><div dir=3D"ltr">- Peter Lauck</div></div>=
</div><span class=3D"">
<br><div class=3D"gmail_quote">On Fri, May 22, 2015 at 1:44 PM, Peter Lauck=
 <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" target=3D"_bl=
ank">[email protected]</a>&gt;</span> wrote:<br><blockquote class=3D"gmai=
l_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left=
:1ex"><div dir=3D"ltr">Hey I have a quick question. Will jruby convert my l=
ambdas to java callbacks? To be more specific, I&#39;m working with JavaFX =
(with JRubyFX) and I have a method setCellValueFactory() that expects takes=
 a java Callback as a parameter. Since Java 8 added lambdas, the java code =
might be something like this:<br clear=3D"all"><div><div><div dir=3D"ltr">-=
 Peter Lauck</div></div></div>
</div>
</blockquote></div><br></span></div>
</blockquote></div><br></div>

--001a11354a0048606d0516c0f925--