Skip to content

Instantly share code, notes, and snippets.

@mwhuss
Created June 26, 2014 14:54
Show Gist options
  • Save mwhuss/552fd2a6f2612c73fe06 to your computer and use it in GitHub Desktop.
Save mwhuss/552fd2a6f2612c73fe06 to your computer and use it in GitHub Desktop.
func add(a: Int, b: Int) -> Int {
return a + b
}
add(1, 2)
/// -----
func add(#a: Int, #b: Int) -> Int {
return a + b
}
add(a: 1, b: 2)
/// -----
func add(firstNumber a: Int, secondNumber b: Int) -> Int {
return a + b
}
add(firstNumber: 1, secondNumber: 2)
/// firstNumber and secondNumber are external parameter names. They are used to specify how the caller should name the input params. Internally a and b are used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment