Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: lazy evaluation #1887

Open
andrewbaxter opened this issue Feb 22, 2025 · 0 comments
Open

Docs: lazy evaluation #1887

andrewbaxter opened this issue Feb 22, 2025 · 0 comments

Comments

@andrewbaxter
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ❓Triage
Development

No branches or pull requests

1 participant