Skip to content

Commit fb3b59b

Browse files
jayjayjpgjosevalim
authored andcommitted
Add short paragraph about arity in getting started/basic types chapter (elixir-lang#890)
1 parent 9566d74 commit fb3b59b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

getting-started/basic-types.markdown

+4-1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ iex> trunc(3.58)
7777
3
7878
```
7979

80+
## Identifying functions
81+
82+
Functions in Elixir are identified by both their name and their arity. The arity of a function describes the number of arguments which the function takes. From this point on we will use both the function name and its arity to decribe functions throughout the documentation. `round/1` identifies the function which is named `round` and takes 1 argument, whereas `round/2` identifies a different (nonexistent) function with the same name but with an arity of only `2`.
83+
8084
## Booleans
8185

8286
Elixir supports `true` and `false` as booleans:
@@ -90,7 +94,6 @@ false
9094

9195
Elixir provides a bunch of predicate functions to check for a value type. For example, the `is_boolean/1` function can be used to check if a value is a boolean or not:
9296

93-
> Note: Functions in Elixir are identified by name and by number of arguments (i.e. arity). Therefore, `is_boolean/1` identifies a function named `is_boolean` that takes 1 argument. `is_boolean/2` identifies a different (nonexistent) function with the same name but different arity.
9497

9598
```iex
9699
iex> is_boolean(true)

0 commit comments

Comments
 (0)