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.




: array-max ( addr len -- max )
  dup 0= if nip exit then
  over @  rot cell+  rot 1-
  cells bounds ?do  i @ max  cell +loop ;
 
: stack-max ( n ... m count -- max ) 1 ?do max loop ;