@@ -131,7 +131,7 @@ defmodule IO do
131
131
defguardp is_device ( term ) when is_atom ( term ) or is_pid ( term )
132
132
defguardp is_iodata ( data ) when is_list ( data ) or is_binary ( data )
133
133
134
- @ doc """
134
+ @ doc ~S """
135
135
Reads from the IO `device`.
136
136
137
137
The `device` is iterated as specified by the `line_or_chars` argument:
@@ -141,7 +141,7 @@ defmodule IO do
141
141
non-textual inputs.
142
142
143
143
* if `line_or_chars` is `:line`, the device is iterated line by line.
144
- CRFL newlines ("\r \n ") are automatically normalized to "\n ".
144
+ CRLF newlines ("\r\n") are automatically normalized to "\n".
145
145
146
146
* if `line_or_chars` is `:eof` (since v1.13), the device is iterated until `:eof`.
147
147
If the device is already at the end, it returns `:eof` itself.
@@ -186,7 +186,7 @@ defmodule IO do
186
186
:io . get_chars ( map_dev ( device ) , ~c" " , count )
187
187
end
188
188
189
- @ doc """
189
+ @ doc ~S """
190
190
Reads from the IO `device`. The operation is Unicode unsafe.
191
191
192
192
The `device` is iterated as specified by the `line_or_chars` argument:
@@ -196,7 +196,7 @@ defmodule IO do
196
196
non-textual inputs.
197
197
198
198
* if `line_or_chars` is `:line`, the device is iterated line by line.
199
- CRFL newlines ("\r \n ") are automatically normalized to "\n ".
199
+ CRLF newlines ("\r\n") are automatically normalized to "\n".
200
200
201
201
* if `line_or_chars` is `:eof` (since v1.13), the device is iterated until `:eof`.
202
202
If the device is already at the end, it returns `:eof` itself.
@@ -603,7 +603,7 @@ defmodule IO do
603
603
@ spec stream ( ) :: Enumerable . t ( String . t ( ) )
604
604
def stream , do: stream ( :stdio , :line )
605
605
606
- @ doc """
606
+ @ doc ~S """
607
607
Converts the IO `device` into an `IO.Stream`.
608
608
609
609
An `IO.Stream` implements both `Enumerable` and
@@ -632,11 +632,11 @@ defmodule IO do
632
632
633
633
Another example where you might want to collect a user input
634
634
every new line and break on an empty line, followed by removing
635
- redundant new line characters (`"\\ n"`):
635
+ redundant new line characters (`"\n"`):
636
636
637
637
IO.stream(:stdio, :line)
638
- |> Enum.take_while(&(&1 != "\\ n"))
639
- |> Enum.map(&String.replace(&1, "\\ n", ""))
638
+ |> Enum.take_while(&(&1 != "\n"))
639
+ |> Enum.map(&String.replace(&1, "\n", ""))
640
640
641
641
"""
642
642
@ spec stream ( device , :line | pos_integer ) :: Enumerable . t ( )
@@ -658,7 +658,7 @@ defmodule IO do
658
658
@ spec binstream ( ) :: Enumerable . t ( binary )
659
659
def binstream , do: binstream ( :stdio , :line )
660
660
661
- @ doc """
661
+ @ doc ~S """
662
662
Converts the IO `device` into an `IO.Stream`. The operation is Unicode unsafe.
663
663
664
664
An `IO.Stream` implements both `Enumerable` and
0 commit comments