Re: Enable async/await to work on functions that don't just return promises.

2017-02-26 Thread Codefined
A very interesting read indeed Alexander!  Gave me a new example to give when people ask what the worst code I'd ever seen was: Promise DoSomething(Promise cmd) { return cmd.WhenResolved( s => { if (s == "...") { return DoSomethingElse(...).WhenResolved( v => { return ...; }, e => { Log(e); thro

Re: Enable async/await to work on functions that don't just return promises.

2017-02-26 Thread Codefined
developer out there just wants the best for the language as a whole, so maybe you should look at the counter-arguments to co-routines to see where they're coming from and attempt to fix them? On 26/02/2017 16:35:16, Florian Bösch wrote: On Sun, Feb 26, 2017 at 5:30 PM, Codefined mailto:c

Re: Enable async/await to work on functions that don't just return promises.

2017-02-26 Thread Codefined
Thank-you guys for the excellent problems with the previous idea, to attempt to fix as many of them as I can, here is an alteration to the proposal: You have two types of functions, asynchronous and synchronous functions.  To distinguish between them, an asynchronous function has the keyword of

Re: Enable async/await to work on functions that don't just return promises.

2017-02-26 Thread Codefined
Ah, that would indeed make sense.  What I feel we need is some way of making an asynchronous function "appear" to be synchronous.  Actually that's sort of what I expected async/await to do, but that only seems to affect where it's called, as opposed to the function itself.___

Re: Enable async/await to work on functions that don't just return promises.

2017-02-26 Thread Codefined
nts for both! Please Google them! On Sun, 26 Feb 2017 at 00:01, Florian Bösch mailto:pya...@gmail.com]> wrote: On Sat, Feb 25, 2017 at 11:55 PM, Codefined mailto:codefi...@debenclipper.com]> wrote: This seems to be so very confusing for anybody new studying this language, almost everyone I

Re: Enable async/await to work on functions that don't just return promises.

2017-02-26 Thread Codefined
re, in that it allows explicitly non-local jumps, provided they're correctly typed. - Isiah Meadows m...@isiahmeadows.com On Sat, Feb 25, 2017 at 5:55 PM, Codefined wrote: > It strikes me as an interesting development to see that the current > definition of Async/Await (as I see

Enable async/await to work on functions that don't just return promises.

2017-02-25 Thread Codefined
It strikes me as an interesting development to see that the current definition of Async/Await (as I see it), is just simple syntactic sugar for `.then()`.   While I, to an extent, see the point of such a command as being useful, I remain unaware of the exact reasoning why we need to include promi