Skip to content

Commit 1dd09cb

Browse files
committed
Document ranges structs are read-only
1 parent 203cb4b commit 1dd09cb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/elixir/lib/range.ex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ defmodule Range do
6868
iex> range.step
6969
2
7070
71+
You can access the range fields (`first`, `last`, and `step`)
72+
directly but you should not modify nor create ranges by hand.
73+
Instead use the proper operators or `new/2` and `new/3`.
74+
7175
A range implements the `Enumerable` protocol, which means
7276
functions in the `Enum` module can be used to work with
7377
ranges:

0 commit comments

Comments
 (0)