First time reading about the `await? foo()` variant. That's not terrible. Having the choice between that and `await foo()?` seems pretty good. Slight preference towards the latter, but I'd be good with either version tbh.
-
Show this thread
-
Tho if the former passes I sincerely hope nobody writes code like this: let res = await? foo()?; Figuring out what's going on there might take a while. Naming things might be hard, but remembering operator precedence can be harder.
1 reply 0 retweets 1 likeShow this thread -
-
Replying to @withoutboats
Yeah actually; it's closer to how math operations would be scoped, which is something I'm already used to. Though in a real program I'd likely split this off into two lines to make it easier to read. let fut = foo()?; let res = await fut()?;
1 reply 0 retweets 3 likes -
Replying to @yoshuawuyts @withoutboats
Isn't await? foo()? in fact closer to math? :) Someone wrote this on github: sin (x^2) = sin x^2 (sin x)^2 = sin^2 x (sin (x^2))^2 = sin^2 x^2 await (x?) = await x? (await x)? = await? x (await (x?))? = await? x?
2 replies 0 retweets 1 like -
Replying to @stjepang
Haha, okay yeah I think it's becoming time I write a blog post :p
1 reply 0 retweets 1 like -
Replying to @yoshuawuyts @stjepang
Sorry, realizing this feels a bit like I'm dodging. I mean: you make interesting points that I don't necessarily agree with, but would like to engage with properly, but it's a Sunday so not today? Haha, hope that makes sense?
1 reply 0 retweets 0 likes -
Replying to @yoshuawuyts
Haha, no need to feel pressured about this, we can discuss another time. Have a great Sunday! <3
1 reply 0 retweets 1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.