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
Could TextIOWrapper be made to be an enumerable of string? I am able to do this with a cast, which generates a call to get_enumerator that happens to call iter() on the object and work:
use result = builtins.``open``("test.txt", OpenTextMode.Read)for(line: string)in!!result doletline= line.Trim()
builtins.print $"'{line}'"
I can also use readline directly for a typesafe verison, but as a side note, I also noticed that it requires a parameter, where as the parameter should be optional:
use result = builtins.``open``("test.txt", OpenTextMode.Read)let mutableline= result.readline (-1)
line <- line.Trim()while line <>""do
line <- line.Trim()
builtins.print $"'{line}'"
line <- result.readline (-1)
The text was updated successfully, but these errors were encountered:
Could
TextIOWrapper
be made to be an enumerable of string? I am able to do this with a cast, which generates a call toget_enumerator
that happens to calliter()
on the object and work:I can also use readline directly for a typesafe verison, but as a side note, I also noticed that it requires a parameter, where as the parameter should be optional:
The text was updated successfully, but these errors were encountered: