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

a bit like Lua ! #40

Open
weepy opened this issue Dec 9, 2016 · 1 comment
Open

a bit like Lua ! #40

weepy opened this issue Dec 9, 2016 · 1 comment

Comments

@weepy
Copy link

weepy commented Dec 9, 2016

Lua does something similar - from https://www.lua.org/pil/5.html

An expression like o:foo(x) is just another way to write o.foo(o, x), that is, to call o.foo adding o as a first extra argument. 

It wouldn't help with using const {map} = Array.prototype but it would allow functional thisless pure pipelines. E.g:

a::map( upperCase )::filter( s => s.length > 5 )  

would be compiled to

filter( map(a, upperCase), (s) => s.length > 5)

Allowing functions to be written like like :

function upperCase(name) {
    return name.toUpper()
}
@calebmer
Copy link

calebmer commented Dec 9, 2016

Also see https://github.com/mindeavor/es-pipeline-operator

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

No branches or pull requests

2 participants