Skip to content

Commit 79ae771

Browse files
author
Dave Wu
authored
Update 12-io.md
typo '元祖' -> '元组'
1 parent 7b34f2e commit 79ae771

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

12-io.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ end
9898
{:ok, body} = File.read(file)
9999
```
100100

101-
当遇到文件不存在的情况时,函数返回`{:error, reason}`然后导致在跟左侧元祖做模式匹配时失败
101+
当遇到文件不存在的情况时,函数返回`{:error, reason}`然后导致在跟左侧元组做模式匹配时失败
102102
失败依然会抛出一个异常,但是该异常的错误信息是描述一次模式匹配失败,而不是文件的什么错误。
103103
从而在一定程度上掩盖了真正的失败原因。
104104

@@ -140,7 +140,7 @@ iex> Path.expand("~/hello")
140140

141141
## 进程(Processes)和组长(group leaders)
142142

143-
你可能已经注意到`File.open/2`函数返回类似`{:ok, pid}`的元祖
143+
你可能已经注意到`File.open/2`函数返回类似`{:ok, pid}`的元组
144144

145145
```elixir
146146
iex> {:ok, file} = File.open "hello", [:write]
@@ -163,7 +163,7 @@ iex> IO.write(pid, "hello")
163163
** (ErlangError) erlang error: :terminated
164164
```
165165

166-
调用`IO.write/2`之后,可以看到`IO`模块发出的请求(四个元素的元祖)被打印了出来。
166+
调用`IO.write/2`之后,可以看到`IO`模块发出的请求(四个元素的元组)被打印了出来。
167167
不久后,因为我们并未提供`IO`模块期待的某种结果,这个请求失败了。
168168

169169
[`StringIO`模块](http://elixir-lang.org/docs/stable/elixir/StringIO.html)

0 commit comments

Comments
 (0)