3 ms·
there is but I don't know if it can be retrofitted onto java. In rust and haskell, ect. types can be worked out backwards so that the type is figure out with u
by rat87 11y ago
there is but I don't know if it can be retrofitted onto java.
In rust and haskell, ect. types can be worked out backwards so that the type is figure out with use.
fn main() {
let mut v = Vec::new();
v.push("hello");
v.push("world!");
println!("output: {:?}", v.join(" "));
}
the type of v is `Vec<&str>` worked out backwards from where &str literal is added(since the type of push is fn `push(&mut self, value: T)` the T generic of Vec<T> must be &str).