Ad
Code
Diff
  • add = -> a, b { a + b }
    square = -> x { x * x }
    
    result = square[add[add[add[1,2],3],4]]
    
    puts result
    • add = -> a, b { a + b }
    • square = -> x { x * x }
    • # sigh, if only Ruby supported pipes!
    • result = square.(add.(add.(add.(1,2), 3), 4))
    • result = square[add[add[add[1,2],3],4]]
    • puts result