3 ms·
I was impressed that even with all this translation and Java compatibility going on, the sample code still shows some situations where the nice clean, concise n
by lnanek2 12y ago
I was impressed that even with all this translation and Java compatibility going on, the sample code still shows some situations where the nice clean, concise nature of Ruby is still up and running. E.g.:
> @paths.each { |path, paint| canvas.drawPath(path, paint) } if @paths
From:
https://github.com/HipByte/RubyMotionSamples/blob/master/android/Paint/app/main_activity.rb https://github.com/HipByte/RubyMotionSamples/blob/master/and...
And:
@activity.handler.post -> { @activity.updateTimer }
From:
https://github.com/HipByte/RubyMotionSamples/blob/master/android/Timer/app/main_activity.rb https://github.com/HipByte/RubyMotionSamples/blob/master/and...
These things take a lot of lines in Java for Android where we don't have lambdas and function references yet and often have to define anonymous classes just to pass a method in to a handle to be run later.