Skip to content

test_21_call_a_function

David Pollak edited this page Jan 13, 2012 · 1 revision

Call a Function

This test defines a function f that adds 33 to the incoming parameter. The res function invokes the f function with the number 3. The output of res should be 36 and that's what is tested.

// define a function, f
f n =
  v = 33
  n + v

// The result of the computation
res = f 3