Skip to content

zh-cn for Tour: multiple parameter lists #1173

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

Merged
merged 4 commits into from
Nov 14, 2018
Merged

Conversation

declan94
Copy link
Member

Simplified Chiniese version for Tour: multiple parameter lists

Copy link

@Qi77Qi Qi77Qi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm other than one minor comment


方法可以定义多个参数列表,当使用较少的参数列表调用多参数列表的方法时,会产生一个新的函数,该函数接收剩余的参数列表作为其参数。这被称为[柯里化](https://zh.wikipedia.org/wiki/%E6%9F%AF%E9%87%8C%E5%8C%96)。

下面是一个例子,在Scala集合中定义的特质[Traversable](/overviews/collections/trait-traversable.html):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the link to Traversable doesn't seem to work, which doesn't work in https://github.com/scala/docs.scala-lang/blob/master/_tour/multiple-parameter-lists.md either

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean the link jumps to the English version?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the link in the newest commit and now it points to the Chinese version

Copy link
Member Author

@declan94 declan94 Oct 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, it works. Have you followed the following instructions in the README?

Quickstart

To build and view the site locally:

gem install bundler
bundle install
bundle exec jekyll serve -I

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh nvm...I thought it's a link to the md file

Copy link
Member

@dongxuwang dongxuwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good except one.

```
numbers.foldLeft(0)(_ + _)
```
上述声明`numbers.foldLeft(0)(_ + _)`让我们可以指定参数`z`,然后再传递折叠函数,并且可以复用,如下所示:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-让我们可以指定参数`z`,然后再传递折叠函数,并且可以复用,如下所示:
+上述语句让我们可以固定参数`z`来形成一个部分函数进行传递,达到复用的目的,如下所示:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After doing some research[1][2], I kind of believe that's what's supposed to mean, but not 100 percent sure.
1 https://www.grokacademy.com/lessons/demystifying-currying-and-partial-function-application/
2 https://goo.gl/oGhpTW

Copy link

@Qi77Qi Qi77Qi Oct 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all it wants to say is currying allows you to fix z and reuse the partially applied function... Above statement numbers.foldLeft(0)(_ + _) in the Eng version is a bit confusing

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dongxuwang I think you're right.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Qi77Qi Agree!
It always makes us crazy that partially applied function, partially function application, partial function. together with the PartialFunction etc.

Copy link
Member

@dongxuwang dongxuwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks better.

@SethTisue SethTisue merged commit 3423ca7 into scala:master Nov 14, 2018
@SethTisue
Copy link
Member

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants