Skip to content

Latest commit

 

History

History
56 lines (40 loc) · 2.53 KB

function.md

File metadata and controls

56 lines (40 loc) · 2.53 KB

Function

The Concept

In some languages, functions have their own type. This may or may not be a generic.

What to cover

  • How to define a function How to define a function. How to add functionality to a function. How does scoping the function work?
  • How to use function parameters How to define function parameters and how to use them.
  • How to return a value from a function How to return a value from a function. Does it require a specific keyword?
  • How to call a function How to call a function and pass arguments to it.

Exercises

Lasagna cooking

This exercise deals with cooking a lasagna dish in the oven. The reference implementation (F#) teaches:

  • How to define a function with one or two parameters.
  • How to use parameters in a function.
  • How to return a value from a function.
  • How to call a function.

Implementations

Track Exercise Changes
C# basics None
F# basics None
Julia functions-introduction None
Ruby basics None
Elixir basics None

Closure Maker

This exercise deals with creating set of functions which return functions that make use of closures.

  • How to define anonymous (lambda) functions.
  • How to return a function from a function.
  • How to use a variable in a closure.

Implementations

Track Exercise Changes
Elixir basics None