๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ
- Mastodon: @nrc
- Twitter: @nick_r_cameron
- Blog: ncameron.org/blog
- Website: ncameron.org
- Pronouns: he/him
๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ
๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ
๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ
Perhaps with an implicit loop?
scanlns!("{} {}", x: u32, y:String, {
...
});
Or perhaps it should still have expression form, but lets you specify types as arguments, e.g., scanlns!("{}, {}", u32, String)
which gives Iterator<Item=(u32, String)>
There is a bug in rustc that I'm currently hitting and which is preventing any progress on the macro front.
https://gist.github.com/mmun/bffc62a5eb6ad648b7f7b2825364962c (cc @mmun)
scan!
for scan-not-a-whole-line case.scan!
should keep trying to match the input until it finds something that matches or we run out of bytes. This matches cin
and scanf
semantics.scan!(...)
to avoid boilerplatey bindings in some cases, e.g.// this snippet also uses default format string inference on the next line
for i in 0..scan!("{}") {
for j in 0..scan!("{}") {
// ...
}
}
scan!()
infer a default format string:
let x: i32 = scan!(); // "{}"
let x: (i32,) = scan!(); // "{}"
let x: (i32, i32) = scan!(); // "{}{}"
Currently using the old proc macro stuff
It currently returns None on an error, but maybe it should return None on a blank line and panic on an error.
We need specialisation with the 'lattice rule' to offer a nice inference-based API which can use the same functions for scanning T
as Result<T>
.
e.g., scanln!("{}", *x)
would infer the type of x
, read that type, then save it into x
library functionallty.
I.e., so that scanned data has trim
applied automatically (or trim_left
/trim_right
).
a useful and working scanln!
macro
We can use the proc macro hack to get around the proc_macro_hygiene
feature, and might be able to find ways around other features.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.