A function that is an abstract function

The complete source of functions_abstract.ek9, compiled by the EK9 compiler. Shown on functions.html.

#!ek9
defines module site.functions.abstractfunction

  defines function
  
    mathOperation() as pure abstract
      -> amount as Float
      <- result as Float?

    multiply() is mathOperation as pure
      -> amount as Float
      <- result as Float: amount * 5.6
      
  defines program
    ShowAbstractFunction()
      stdout <- Stdout()
      
      calculatedResult <- multiply(9)
      stdout.println(`The result is ${calculatedResult}`)

Download functions_abstract.ek9

Output

The result is 50.4