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

Add other languages #1

Open
mtso opened this issue Oct 22, 2017 · 1 comment
Open

Add other languages #1

mtso opened this issue Oct 22, 2017 · 1 comment

Comments

@mtso
Copy link
Owner

mtso commented Oct 22, 2017

In the language of your choice, write an example of:

add(1)(2) // A function that returns a function value.
each([1, 2, 3], print) // A function that takes a function parameter.

Add [language name].[language extension] source file to the root.

For example:

// javascript.js

function add(x) {
  return function(y) { return x + y }
}

function each(list, callback) {
  for (var i = 0; i < list.length; i++) { callback(list[i]) }
}

// Example usage
add(1)(2)
each([1, 2, 3], console.log)

Please limit each pull request to one language, thank you.
Though multiple pull requests are welcome :)

@mtso
Copy link
Owner Author

mtso commented Oct 22, 2017

Will gladly accept improvements to existing examples as not all current languages have complete implementations of both add and each.

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

No branches or pull requests

1 participant