Skip to content
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

Example seems incorrect (or confusing?) #5

Closed
aickin opened this issue Dec 6, 2015 · 4 comments
Closed

Example seems incorrect (or confusing?) #5

aickin opened this issue Dec 6, 2015 · 4 comments
Labels

Comments

@aickin
Copy link

aickin commented Dec 6, 2015

Thanks for this proposal; seems really cool. I was confused by this example, though:

var person = { score: 75 };

var newScore = person.score
  |> double
  |> score => add(7, score)
  |> validateScore

newScore //=> 107

// As opposed to: var newScore = add(7, validateScore( double(person.score) ))

Now I don't know if there's a mistake in the example or if the proposal itself confuses me, but it seems really odd that the functions nest in a different order than they are piped. I would think that they would nest in the same order, with the first piped function as the innermost one, namely:

var newScore = validateScore(add(7, double(person.score) ));

Am I misunderstanding the example? Why do they neat in a different order for this case?

Thanks for all your great work!

@gilbert
Copy link
Collaborator

gilbert commented Dec 6, 2015

Aha, that is a mistake, thank you for pointing it out. I will fix it now.

@pitaj
Copy link

pitaj commented Dec 6, 2015

I think either the example is incorrect or the ad opposed to is.

👍

@gilbert gilbert closed this as completed in 6f3be8e Dec 6, 2015
@aickin
Copy link
Author

aickin commented Dec 6, 2015

Awesome, thanks!

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants