Ruby vs Kotlin syntax for lambdas


The same code expressed in Kotlin

orders.flatMap{ it.products }
orders.flatMap(Order::products)
orders.flatMap{ o -> o.products }

and Ruby:

orders.flat_map(&:products)
orders.flat_map{|o| o.products }

Popularne posty z tego bloga

Ruby vs Kotlin: Custom Comparable classes

re-enable tray icons in ubuntu 13.10?