Forum: JRuby java interoperation; lambda to callbacks?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7c5739aa28960aff10caf8a5fd95c5ff?d=identicon&s=25 Peter Lauck (Guest)
on 2015-05-22 19:45
(Received via mailing list)
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
7c5739aa28960aff10caf8a5fd95c5ff?d=identicon&s=25 Peter Lauck (Guest)
on 2015-05-22 19:53
(Received via mailing list)
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
7c5739aa28960aff10caf8a5fd95c5ff?d=identicon&s=25 Peter Lauck (Guest)
on 2015-05-23 16:56
(Received via mailing list)
Well the method works with a lambda so I assume either jruby or jrubyfx
is
handling that conversion.

- Peter Lauck
This topic is locked and can not be replied to.