On Tue, Oct 7, 2014 at 8:51 AM, Kevin Smith <zenpars...@gmail.com> wrote:
> >> >> [1]:http://wiki.ecmascript.org/doku.php?id=strawman:bind_operator >>> >> >> Problem is :: vs. just dot, and now you have two problems. I'm actually >> good with FP inside-out, could learn to love :: if we add it, but the main >> objection IMHO is two-problems. OOP means just dot. >> > > That reminds me: > > https://esdiscuss.org/topic/merging-bind-syntax-with-relationships > > Hi Kevin, Somehow I had missed that post until now. Interesting! For the sake of clarity while examining alternatives, let's assume for the moment the following infix operators: infix "::" for bind alone as in http://wiki.ecmascript.org/doku.php?id=strawman:bind_operator infix "@" for relationships alone, as in http://wiki.ecmascript.org/doku.php?id=strawman:relationships infix "->" for bind+relationships as you propose here. My question is: If we have "->", how much need would there still be for "::" or "@"? If "->" can subsume the practical need for either or both of the others, that would be interesting. We should postpone any further bikeshedding on which token to use for which meaning until we understand better which ones we actually need. > I know, OOP wins and all, but the downside is that it puts all the burden > onto TC39 for defining a complete iterator API. The double-colon is a bit > nasty-looking, though... Maybe we should consider single-arrow? > > For example: > > import { slice, forEach } from "my-userland-iterator-lib"; > > gimmeIterator()->slice(10, 20)->forEach(x => console.log(x)); > > Or for private fields: > > import { makePrivate } from "private-fields"; > > const _x = makePrivate(); > const _y = makePrivate(); > > class Point { > constructor(x, y) { > this->_x = x; > this->_y = y; > } > } > > > In any case, I think a merged relationships (i.e. private fields) + > binding mechanism would be a *huge* win for the language. > > > _______________________________________________ > es-discuss mailing list > es-discuss@mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > > -- Cheers, --MarkM
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss