Procedural and Functional Programming

A simple procedural style method:

def isZero (n : integer) : String {
  if n == 0 then
    return "isZero";
  else
    return "isn’tZero";
}

And here’s an equivalent functional method:

def isZero (n : integer) : String :>
  if n == 0 then "isZero" else "isn’tZero";
Beyond OmniMark Sam Wilmott
Slide 28 of 37 www.wilmott.ca