Open xooxdoo opened 8 years ago
Here is another alternative from TypeScript community (https://github.com/Microsoft/TypeScript/issues/6018#issuecomment-164757557)
function filter<T> Iterable<T>::(callback: (value: T) => boolean): Iterable<T> { ... }
Eliminate the type annotations and add thisArg:
function filter thisArg::(callback) { ... }
function zip array::(otherArray) {
return array.map( (a, i) => [a, otherArray[i]] )
}
function flatten subject::() {
return subject.reduce( (a,b) => a.concat(b) )
}
I don't much like this syntax, just FYI.
Also I used C# more the past few months and this is very helpful to add functionalities to third party objects without extending them, a really like it now.
they should really add this to JS
As you can see this solves the too many colones you mentioned in #1. And keep the aspects of what i was talking about transparency between the two specs :D.
Also i couldn't grasp the fact that in the first syntax ...
It seems logic to me that if you are not going to let me use
this
keyword inside the function, you should ask me to use it in the argument either :D.Wish the best for you and your suggestion, but please take my syntax in consideration.
And as I suggested in #1 consider merging it with the other spec if that is possible.