Skip to content

Commit 00f2662

Browse files
Fix a few more minor typos (#13801)
1 parent 2f84c1e commit 00f2662

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

lib/elixir/pages/getting-started/comprehensions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Comprehensions
22

3-
In Elixir, it is common to loop over an Enumerable, often filtering out some results and mapping values into another list. Comprehensions are syntactic sugar for such constructs: they group those common tasks into the `for` special form.
3+
In Elixir, it is common to loop over an `Enumerable`, often filtering out some results and mapping values into another list. Comprehensions are syntactic sugar for such constructs: they group those common tasks into the `for` special form.
44

55
For example, we can map a list of integers into their squared values:
66

lib/elixir/pages/getting-started/module-attributes.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ Module attributes as constants and as temporary storage are most often used toge
173173

174174
## Going further
175175

176-
Libraries and frameworks can leverage module attributes to provide custom annotations. To see an example, look no further than Elixir's unit test framework called `ExUnit`. ExUnit uses module attributes for multiple different purposes:
176+
Libraries and frameworks can leverage module attributes to provide custom annotations. To see an example, look no further than Elixir's unit test framework called `ExUnit`. `ExUnit` uses module attributes for multiple different purposes:
177177

178178
```elixir
179179
defmodule MyTest do
@@ -187,8 +187,8 @@ defmodule MyTest do
187187
end
188188
```
189189

190-
In the example above, `ExUnit` stores the value of `async: true` in a module attribute to change how the module is compiled. Tags also work as annotations and they can be supplied multiple times, thanks to Elixir's ability to [accumulate attribute](`Module.register_attribute/3`). Then you can use tags to setup and filter tests, such as avoiding executing Unix specific tests while running your test suite on Windows.
190+
In the example above, `ExUnit` stores the value of `async: true` in a module attribute to change how the module is compiled. Tags also work as annotations and they can be supplied multiple times, thanks to Elixir's ability to [accumulate attributes](`Module.register_attribute/3`). Then you can use tags to setup and filter tests, such as avoiding executing Unix specific tests while running your test suite on Windows.
191191

192-
To fully understand how ExUnit works, we'd need macros, so we will revisit this pattern in the Meta-programming guide and learn how to use module attributes as storage for custom annotations.
192+
To fully understand how `ExUnit` works, we'd need macros, so we will revisit this pattern in the Meta-programming guide and learn how to use module attributes as storage for custom annotations.
193193

194194
In the next chapters, we'll explore structs and protocols before moving to exception handling and other constructs like sigils and comprehensions.

lib/elixir/pages/getting-started/protocols.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ iex> Utility.type(123)
4242

4343
With protocols, however, we are no longer stuck having to continuously modify the same module to support more and more data types. For example, we could spread the `defimpl` calls above over multiple files and Elixir will dispatch the execution to the appropriate implementation based on the data type. Functions defined in a protocol may have more than one input, but the **dispatching will always be based on the data type of the first input**.
4444

45-
One of the most common protocols you may encounter is the `String.Chars` protocol: implementing its `to_string/1` function for your custom structs will tell the Elixir kernel how to represent them as strings. We will explore all built-in protocols later. For now, let's implement our own.
45+
One of the most common protocols you may encounter is the `String.Chars` protocol: implementing its `to_string/1` function for your custom structs will tell the Elixir kernel how to represent them as strings. We will explore all the built-in protocols later. For now, let's implement our own.
4646

4747
## Example
4848

@@ -253,4 +253,4 @@ iex> inspect &(&1+2)
253253
"#Function<6.71889879/1 in :erl_eval.expr/5>"
254254
```
255255

256-
There are other protocols in Elixir but this covers the most common ones. You can learn more about protocols and implementations in the `Protocol` module.
256+
There are other protocols in Elixir, but this covers the most common ones. You can learn more about protocols and implementations in the `Protocol` module.

lib/elixir/pages/getting-started/try-catch-and-rescue.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ It is exactly this supervision system that makes constructs like `try/catch` and
200200

201201
## After
202202

203-
Sometimes it's necessary to ensure that a resource is cleaned up after some action that could potentially raise an error. The `try/after` construct allows you to do that. For example, we can open a file and use an `after` clause to close it -- even if something goes wrong:
203+
Sometimes it's necessary to ensure that a resource is cleaned up after some action that could potentially raise an error. The `try/after` construct allows you to do that. For example, we can open a file and use an `after` clause to close iteven if something goes wrong:
204204

205205
```elixir
206206
iex> {:ok, file} = File.open("sample", [:utf8, :write])

lib/elixir/pages/getting-started/writing-documentation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ We recommend that developers include examples in their documentation, often unde
104104

105105
## Documentation != Code comments
106106

107-
Elixir treats documentation and code comments as different concepts. Documentation is an explicit contract between you and users of your Application Programming Interface (API), be them third-party developers, co-workers, or your future self. Modules and functions must always be documented if they are part of your API.
107+
Elixir treats documentation and code comments as different concepts. Documentation is an explicit contract between you and users of your Application Programming Interface (API), be they third-party developers, co-workers, or your future self. Modules and functions must always be documented if they are part of your API.
108108

109109
Code comments are aimed at developers reading the code. They are useful for marking improvements, leaving notes (for example, why you had to resort to a workaround due to a bug in a library), and so forth. They are tied to the source code: you can completely rewrite a function and remove all existing code comments, and it will continue to behave the same, with no change to either its behavior or its documentation.
110110

0 commit comments

Comments
 (0)