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

Implement a scan macro #4

Open
nrc opened this issue Dec 31, 2021 · 0 comments
Open

Implement a scan macro #4

nrc opened this issue Dec 31, 2021 · 0 comments

Comments

@nrc
Copy link
Owner

nrc commented Dec 31, 2021

Should be easier to implement in ezio than in the general case because we don't need to worry about error handling or optimal performance. Something like the following should work:

// Types should not always be required.
let (foo, bar): (u8, f64) = scanln!("{}, {}");

alternative syntaxes:

let foo: u8;
let bar: f64;
scanln!("{}, {}", foo, bar);
let (foo, bar) = scanln!("{}, {}", u8, f64);

There are many, many ways this could be enhanced following format strings.

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

No branches or pull requests

1 participant