Task

Create a function that returns the maximum value in a provided set of values,

where the number of values may not be known until run-time.




var max = Fn.new { |a| a.reduce { |m, x| (x > m) ? x : m } }
 
var a = [42, 7, -5, 11.7, 58, 22.31, 59, -18]
System.print(max.call(a))