|
|
|
|
|
by mamcx
2220 days ago
|
|
I have thinking something similar but with generators: //A async candidate
fun read_lines(file):
for line in file:
yield line }
let lines = read_lines("hello.txt").await //turn async
I wonder why something like this is not used. Exist a bad interaction that could arise from this? Maybe about how nest stuff? fun uppercase_lines(file):
for line in read_lines(file):
yield line
let lines = uppercase_lines("hello.txt").await //turn async, but also recursivelly read_lines?
|
|