@acmel Rust is very much becoming dominate (especially by my employer). I like the guarantees that Rust brings, so I’m working on learning it. I bought a book on Rust, which really gets into the details of the language, but honestly, isn’t a good way to learn the language. I found that learning by example is a much better approach.
I have a non trivial program I’m writing (it was one of the programs I had to write for my interview), and I’m hitting all the fun corner cases with it. I’m trying hard to keep an open mind, but for someone that’s been programming C for over 3 decades, it’s really hard to do so. ;-)
And today I learn that Rust does not like recursive functions :-(
(In user space, I’m recursive function happy!)
Continuing my Rust Rants :-)
It’s unfortunate that move
is a keyword. As I write my little programs, I found that that’s a common function name I use. Now I need to come up with something else. adjust ?
There’s gotta be a better way…
use std::env;
use std::path::Path;
fn usage(arg: &String) {
let path = Path::new(arg);
println!("usage: {} a b", path.file_name().unwrap().to_str().unwrap());
}
fn main() {
let args = env::args();
if args.len() < 3 {
usage(&args.collect::<Vec<String>>()[0]);
}
}
@joe-lawrence Emacs is more than an operating system. It’s an orchestra.