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
I need to stream lines from a command that runs forever and run code for each line. Naive interpretation of the docs would imply that the since for takes a single value, the evaluation of the value completes before the for begins to execute so trying this with a for loop wouldn't work.
It's ambiguous whether this would work with each, and the documentation for output capture doesn't explicitly state this either. In most languages with first class functions I try to avoid first class functions for simple control flow like this because it messes with other control flow operators, so I was hoping I could use for.
FWIW I searched for variations of "stream" but that only came up with references to "byte streams", "lazy", a few other things (can't remember what) as well as checking the for, each, section on lists vs multiple values, output capture, and command evaluation.
The text was updated successfully, but these errors were encountered:
I need to stream lines from a command that runs forever and run code for each line. Naive interpretation of the docs would imply that the since
for
takes a single value, the evaluation of the value completes before thefor
begins to execute so trying this with afor
loop wouldn't work.It's ambiguous whether this would work with
each
, and the documentation for output capture doesn't explicitly state this either. In most languages with first class functions I try to avoid first class functions for simple control flow like this because it messes with other control flow operators, so I was hoping I could usefor
.FWIW I searched for variations of "stream" but that only came up with references to "byte streams", "lazy", a few other things (can't remember what) as well as checking the
for
,each
, section on lists vs multiple values, output capture, and command evaluation.The text was updated successfully, but these errors were encountered: