You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a problem with await because it's not obvious to when should it be applied - at the stage of declaration or at the stage of execution. Consider code
a|>awaitf
like should it be
awaitf(a)
or
(awaitf)(a)
And while trivial examples would probably prefer the first scenario I think lack of support of second scenario would make the functionality flawed in comparison to .
And even more - the could be
await(awaitobj.f()).g(a)
And there should be a way to write it with |>
So the proposal is to stand on the first way of resolution a |> await f to await f(a) but add a way to achieve second way. As far as I can understand we need some syntax extension for that because it's impossible with current form of proposal. A few things I can get from the top of my head are:
await |> (await f)(a) -> a await |> f (await obj.f())(a) -> a (await |> obj.f()) (await obj.f()).g(a) -> a ((await |> obj.f()) g) await (await obj.f()).g(a) -> a (await (await |> obj.f()) g)
awaited (await f)(a) -> a |> awaited f (await obj.f())(a) -> a |> awaited obj.f() (await obj.f()).g(a) -> a |> (awaited obj.f()).g await (await obj.f()).g(a) -> a |> await (awaited obj.f()).g
But I'm not standing on any of them and would like to start a discussion about how others are seen the resolution to this problem
The text was updated successfully, but these errors were encountered:
There is a problem with
await
because it's not obvious to when should it be applied - at the stage of declaration or at the stage of execution. Consider codelike should it be
or
And while trivial examples would probably prefer the first scenario I think lack of support of second scenario would make the functionality flawed in comparison to
.
And even more - the could be
And there should be a way to write it with
|>
So the proposal is to stand on the first way of resolution
a |> await f
toawait f(a)
but add a way to achieve second way. As far as I can understand we need some syntax extension for that because it's impossible with current form of proposal. A few things I can get from the top of my head are:await |>
(await f)(a)
->a await |> f
(await obj.f())(a)
->a (await |> obj.f())
(await obj.f()).g(a)
->a ((await |> obj.f()) g)
await (await obj.f()).g(a)
->a (await (await |> obj.f()) g)
awaited
(await f)(a)
->a |> awaited f
(await obj.f())(a)
->a |> awaited obj.f()
(await obj.f()).g(a)
->a |> (awaited obj.f()).g
await (await obj.f()).g(a)
->a |> await (awaited obj.f()).g
But I'm not standing on any of them and would like to start a discussion about how others are seen the resolution to this problem
The text was updated successfully, but these errors were encountered: