-
Notifications
You must be signed in to change notification settings - Fork 1k
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
zh-cn for Scala Tour:Case Classes #1174
Conversation
val message3 = Message("jorge@catalonia.es", "guillaume@quebec.ca", "Com va?") | ||
val messagesAreTheSame = message2 == message3 // true | ||
``` | ||
尽管`message2`和`message3`引用不同的对象,但是他们的值是相等的,所以`message2 == message3`为`true`。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
引用不同的对象
How about this? 參照到不同的物件
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry but I don't think "參照到不同的物件" conforms to common programming terminologies in Chinese.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I got it. It's just the different wording.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
「对象」for "object" is mainland China usage, whereas in Taiwan it is usually 「物件」.
Are you in any QQ or wechat group? |
Not yet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没毛病lgtm
_zh-cn/tour/case-classes.md
Outdated
message5.recipient // claire@bourgogne.fr | ||
message5.body // "Me zo o komz gant ma amezeg" | ||
``` | ||
上述代码`message4`的`recipient`被用作为了`message5`的`sender`,重新指定了`message5`的`recipient`,而`message4`的`body`则是直接拷贝作为`message5`的`body`了。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
被用作为了
这里不通顺
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, have reorganized statement.
@declan94 want to get this across the finish line? looks like there's one review comment from @dongxuwang that you haven't responded to yet |
Thanks, have responded and submitted another commit |
@@ -13,3 +13,48 @@ language: zh-cn | |||
next-page: pattern-matching | |||
previous-page: multiple-parameter-lists | |||
--- | |||
|
|||
案例类(Case classes)和普通类差不多,只有几点关键差别,接下来的介绍将会涵盖这些差别。案例类非常适合用于不可变的数据。下一节将会介绍他们在[模式匹配](pattern-matching.html)中的应用。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我看 Programming Scala 中文版翻译为样例类
。这里翻译为案例类
有什么特别的缘由么?如果可能,最好能够统一。
我个人倾向样例类
,因为字面上其与pattern match有所关联,而且不必创造新的词。但是,如果多数人共识使用案例类
,我觉得也行。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我们是处理成case类的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
case类
我觉得也可以,没有任何误解的可能性。
@liufengyun is this ready for merge? |
ping @liufengyun |
Yes, I think it can go in. |
thank you @declan94 and reviewers! |
Simplified Chinese version of Scala Tour:Case Classes