Skip to content

Commit c2c4cad

Browse files
authored
Replace statement -> expression when relevant (#13621)
1 parent 8dabe63 commit c2c4cad

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lib/elixir/lib/macro.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ defmodule Macro do
779779
## Options
780780
781781
* `:unquote` - when true, this function leaves `unquote/1` and
782-
`unquote_splicing/1` statements unescaped, effectively unquoting
782+
`unquote_splicing/1` expressions unescaped, effectively unquoting
783783
the contents on escape. This option is useful only when escaping
784784
ASTs which may have quoted fragments in them. Defaults to false.
785785

lib/elixir/pages/anti-patterns/code-anti-patterns.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ Elixir makes a clear distinction between **documentation** and code comments. Th
5050

5151
#### Problem
5252

53-
This anti-pattern refers to `with` statements that flatten all its error clauses into a single complex `else` block. This situation is harmful to the code readability and maintainability because it's difficult to know from which clause the error value came.
53+
This anti-pattern refers to `with` expressions that flatten all its error clauses into a single complex `else` block. This situation is harmful to the code readability and maintainability because it's difficult to know from which clause the error value came.
5454

5555
#### Example
5656

57-
An example of this anti-pattern, as shown below, is a function `open_decoded_file/1` that reads a Base64-encoded string content from a file and returns a decoded binary string. This function uses a `with` statement that needs to handle two possible errors, all of which are concentrated in a single complex `else` block.
57+
An example of this anti-pattern, as shown below, is a function `open_decoded_file/1` that reads a Base64-encoded string content from a file and returns a decoded binary string. This function uses a `with` expression that needs to handle two possible errors, all of which are concentrated in a single complex `else` block.
5858

5959
```elixir
6060
def open_decoded_file(path) do

lib/elixir/src/elixir_rewrite.erl

+1-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ inner_inline(_, _, _, _) -> false.
228228
%%
229229
%% Rewrite rules are more complex than regular inlining code
230230
%% as they may change the number of arguments. However, they
231-
%% don't add new code (such as case statements), at best they
231+
%% don't add new code (such as case expressions), at best they
232232
%% perform dead code removal.
233233
rewrite(?string_chars, DotMeta, to_string, Meta, [Arg]) ->
234234
case is_always_string(Arg) of

0 commit comments

Comments
 (0)