Skip to content

Commit 832fbce

Browse files
eksperimentaljosevalim
authored andcommitted
Fix grammar in Range docs (#10851)
- Use "with a step of X" - Replace usage of "start" and "stop" with "first" and "last"
1 parent c45d9ab commit 832fbce

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

lib/elixir/lib/calendar/date.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ defmodule Date do
9292
def range(%{calendar: calendar} = first, %{calendar: calendar} = last) do
9393
{first_days, _} = to_iso_days(first)
9494
{last_days, _} = to_iso_days(last)
95-
# TODO: Deprecate inferring a range with step of -1 on Elixir v1.16
95+
# TODO: Deprecate inferring a range with a step of -1 on Elixir v1.16
9696
step = if first_days <= last_days, do: 1, else: -1
9797
range(first, first_days, last, last_days, calendar, step)
9898
end
@@ -102,7 +102,7 @@ defmodule Date do
102102
end
103103

104104
@doc """
105-
Returns a range of dates with step.
105+
Returns a range of dates with a step.
106106
107107
## Examples
108108

lib/elixir/lib/kernel.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3673,7 +3673,7 @@ defmodule Kernel do
36733673
end
36743674

36753675
defp range(_context, first, last) when is_integer(first) and is_integer(last) do
3676-
# TODO: Deprecate inferring a range with step of -1 on Elixir v1.17
3676+
# TODO: Deprecate inferring a range with a step of -1 on Elixir v1.17
36773677
step = if first <= last, do: 1, else: -1
36783678
{:%{}, [], [__struct__: Elixir.Range, first: first, last: last, step: step]}
36793679
end

lib/elixir/lib/range.ex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ defmodule Range do
2929
iex> Enum.to_list(0..10//-1)
3030
[]
3131
32-
When defining a range without steps, the step will be
33-
defined based on the start and stop position of the
34-
range, If `start >= stop`, it will be an increasing range
35-
with step of 1. Otherwise, it is a decreasing range.
32+
When defining a range without a step, the step will be
33+
defined based on the first and last position of the
34+
range, If `first >= last`, it will be an increasing range
35+
with a step of 1. Otherwise, it is a decreasing range.
3636
Note however implicitly decreasing ranges are deprecated.
3737
Therefore, if you need a decreasing range from `3` to `1`,
3838
prefer to write `3..1//-1` instead.
@@ -120,7 +120,7 @@ defmodule Range do
120120

121121
@spec new(limit, limit) :: t
122122
def new(first, last) when is_integer(first) and is_integer(last) do
123-
# TODO: Deprecate inferring a range with step of -1 on Elixir v1.17
123+
# TODO: Deprecate inferring a range with a step of -1 on Elixir v1.17
124124
step = if first <= last, do: 1, else: -1
125125
%Range{first: first, last: last, step: step}
126126
end

0 commit comments

Comments
 (0)