Corso di Raku / Programmazione funzionale, concorrente, reattiva e web / Programmazione reattiva / await / Attendere una promise
Quiz — await
Cosa stampa il programma seguente?
my $p = start { 8 * 8 };
say await $p;| 0 | Promise |
| 0 | 8 |
| 1 | 64 |
| 0 | True |
await aspetta che l’unica promise finisca e ne
restituisce il risultato. Il blocco calcola 8 * 8, quindi
await $p è 64.