From 1892c450cfc8e1db9d59317906d22a8440a7f021 Mon Sep 17 00:00:00 2001 From: Ahmed Kamal Date: Sun, 6 Oct 2024 23:13:30 +1100 Subject: [PATCH 1/2] docs: add arity to macro reference of def/2 and defmodule/2 --- lib/elixir/pages/getting-started/modules-and-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/elixir/pages/getting-started/modules-and-functions.md b/lib/elixir/pages/getting-started/modules-and-functions.md index 31a3cba5fd2..252f355b84d 100644 --- a/lib/elixir/pages/getting-started/modules-and-functions.md +++ b/lib/elixir/pages/getting-started/modules-and-functions.md @@ -7,7 +7,7 @@ iex> String.length("hello") 5 ``` -In order to create our own modules in Elixir, we use the `defmodule` macro. The first letter of the module must be in uppercase. We use the `def` macro to define functions in that module. The first letter of every function must be in lowercase (or underscore): +In order to create our own modules in Elixir, we use the `defmodule/2` macro. The first letter of the module must be in uppercase. We use the `def/2` macro to define functions in that module. The first letter of every function must be in lowercase (or underscore): ```elixir iex> defmodule Math do From a4a83f02297b208c8b36736ed1402f4b098cc1a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Mon, 7 Oct 2024 11:56:52 +0200 Subject: [PATCH 2/2] Update lib/elixir/pages/getting-started/modules-and-functions.md Co-authored-by: Andrea Leopardi --- lib/elixir/pages/getting-started/modules-and-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/elixir/pages/getting-started/modules-and-functions.md b/lib/elixir/pages/getting-started/modules-and-functions.md index 252f355b84d..a369a660827 100644 --- a/lib/elixir/pages/getting-started/modules-and-functions.md +++ b/lib/elixir/pages/getting-started/modules-and-functions.md @@ -7,7 +7,7 @@ iex> String.length("hello") 5 ``` -In order to create our own modules in Elixir, we use the `defmodule/2` macro. The first letter of the module must be in uppercase. We use the `def/2` macro to define functions in that module. The first letter of every function must be in lowercase (or underscore): +In order to create our own modules in Elixir, we use the [`defmodule`](`defmodule/2`) macro. The first letter of the module must be in uppercase. We use the [`def`](`def/2`) macro to define functions in that module. The first letter of every function must be in lowercase (or underscore): ```elixir iex> defmodule Math do