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

stdlib: Add input function #2074

Open
spotandjake opened this issue Mar 22, 2024 · 2 comments
Open

stdlib: Add input function #2074

spotandjake opened this issue Mar 22, 2024 · 2 comments

Comments

@spotandjake
Copy link
Member

In python there is the input function which makes reading inputs syncronously from the command line super easy. This helps to position python in an especially useful place for learning to program and writing simple interactive programs. It would be great if we could add a function like this, currently this behaviour could be done through stdin but exposing a nice user friendly function would greatly help with developer experience.

I think the desired type for this would be input(prompt="") => string, if we ever get async capabilities in grain, it would also be great if this was an async function.

We may want to consider adding some sort of console library that contains functions like this and possibly additional printing utils like printTable.

@ospencer
Copy link
Member

ospencer commented Apr 5, 2024

Requires #1583

@ospencer
Copy link
Member

ospencer commented Apr 5, 2024

I also agree that this should be in its own library, including things like readLine, etc.

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

No branches or pull requests

2 participants