Skip to content

Conversation

ochrons
Copy link
Contributor

@ochrons ochrons commented Jan 31, 2016

No description provided.

@stewSquared
Copy link

And line 416 isn't completely true. Currying isn't distinguished as a concept from partial application by multiple parameter lists, although it's true that currying is allowed in scala if you write a function with multiple parameter lists. Perhaps it's best just to give a simple, language-agnostic definition of currying here.

@sjrd
Copy link
Member

sjrd commented Feb 1, 2016

@stewSquared Thanks for the proofreading. It is easier to process it if you use line comments, though, as then the comments are visually attached to the lines you're commenting on. It would be easier for you, too, as you won't have to report the line numbers into your comment.

@stewSquared
Copy link

@sjrd Of course! Thanks for the tip.

@ochrons
Copy link
Contributor Author

ochrons commented Feb 2, 2016

In the Scala documentation currying is defined as

Methods may define multiple parameter lists. When a method is called with a fewer number of parameter lists, then this will yield a function taking the missing parameter lists as its arguments.

Another Scala definition I found was

Currying transforms a function that takes multiple parameters into a chain of functions, each taking a single parameter. Curried functions are defined with multiple parameter lists.

Of course the "purist" view is that curried function has always only a single parameter, but in practice "currying" is used in a more relaxed way in Scala. For our purpose, the point of multiple parameter lists is more important than the "real" currying.

@stewSquared
Copy link

Okay, that's a fair point. I'm glad to help out!

language, provides much more when it comes to functions. Let's explore some of the more advanced features and how they
compare to JavaScript.

#### Higher-order functions
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be a level-3 header (and not 4)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The 2 vs 4 level has been used elsewhere, too, for better visual clarity.

Copy link
Member

Choose a reason for hiding this comment

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

OK let's keep it that way for now, but we should globally fix this another time.

@sjrd
Copy link
Member

sjrd commented Feb 27, 2016

That's all.

@sjrd
Copy link
Member

sjrd commented Mar 2, 2016

LGTM

sjrd added a commit that referenced this pull request Mar 2, 2016
Fixes #225, add a section on Scala functions
@sjrd sjrd merged commit 505373d into scala-js:master Mar 2, 2016
@ochrons ochrons deleted the functions branch March 3, 2016 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants