Tyler Close writes:
> Instead of making Javascript promises directly invokable, as in:
>
> drum_.post('bang', [ 1 ])
>
> we make all eventual invocations via a global object, so:
>
> Q.post(drum, 'bang', [ 1 ])
>
> The 'drum' reference can be either a promise or an immediate
> reference; either way, the invocation is still an eventual invocation.
[...]
> I think the last line is the only one that presents a significant
> concern. In the current syntax, it's:
>
> hits_ = drum_.post('bang', [ 3 ]).get('hits')
[but in the proposed new syntax it's:]
> hits = Q.get(Q.post(drum, 'bang', [ 3 ]), 'hits')
>
> This inversion happens to the whole chain of calls in the statement.
I haven't been following this too closely, but would the following
be any better? Javascript promises wouldn't be directly invokable,
but must be passed in a call to a global function Q to obtain an
object that can be directly invoked, like this:
Q(drum).post('bang', [ 1 ])
The problem line at the end of your post becomes
hits = Q(Q(drum).post('bang', [ 3 ])).get('hits')
Is this any better?
This variant doesn't provide a naming convention on the variables
themselves, only a special syntax at the place where those variables
are used -- just like your proposal. The only advantage of this
variant over your proposal is that this variant avoids the inversion.
_______________________________________________
e-lang mailing list
e-lang@...
http://www.eros-os.org/mailman/listinfo/e-lang