Subject: | Consider await at toplevel |
Before async/await it's common at the toplevel of the main script, to write such code as
$thing->do_something->then(sub {
...
})->...
->get;
I.e. to invoke ->get to force futures and wait for them. This is quite rude inside a module, but at toplevel of the main script is quite fine.
If you want to make use of async/await syntax at toplevel of the script it seems annoying to have to (async sub { ...})->() wrap the entire program. We might offer a special-case exemption for `await` expressions directly inside PL_maincv, by allowing
await $thing->do_something;
at toplevel.
Thoughts?
--
Paul Evans