Skip to content

2.8节的逗号运算符 #1158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
loxxxyk opened this issue Jun 15, 2023 · 3 comments · Fixed by #1165
Closed

2.8节的逗号运算符 #1158

loxxxyk opened this issue Jun 15, 2023 · 3 comments · Fixed by #1165
Labels
Solved Problem solved

Comments

@loxxxyk
Copy link

loxxxyk commented Jun 15, 2023

原文:逗号运算符能让我们处理多个语句,使用 , 将它们分开。每个语句都运行了,但是只有最后的语句的结果会被返回。

逗号运算符应该是分割表达式?

@songhn233
Copy link
Member

Hello,首先原文中是 comma operator,直译即为逗号运算符,同时常见翻译中都会采取这种说法,图为中文维基百科。

image

另外分割表达式在常见搜索引擎中并没有比较可靠的检索源,不太清楚你所指的具体来源。

如果有其他问题可以继续补充~

@songhn233 songhn233 added the question Further information is requested label Jul 2, 2023
@loxxxyk
Copy link
Author

loxxxyk commented Jul 5, 2023

感谢回复。我没表述清楚,不是针对“逗号运算符”的翻译哈,感觉“逗号运算符”分割的是表达式而不是语句。

原文:逗号运算符能让我们处理多个语句,使用 , 将它们分开。每个语句都运行了,但是只有最后的语句的结果会被返回。

我理解的:逗号运算符能让我们处理多个表达式,使用 , 将它们分开。每个表达式都计算了,但是只有最后的表达式的结果会被返回。

image

@songhn233 songhn233 reopened this Jul 5, 2023
@songhn233
Copy link
Member

@huashen84,感谢指出,这里确实有必要区分语句(statement)和表达式(expression)。

@leviding leviding added Solved Problem solved and removed question Further information is requested labels Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Solved Problem solved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants