Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Reasons not to use Rust

Name: Anonymous 2015-04-08 12:21

- You think programming languages should be closed and proprietary
- You like random pauses caused by forced collection of the garbage
- You think program start-up should take minutes so you use stupid VM-languages instead
- You like broken features and memory corruption
- You sell hardware and want to deploy inefficient scripting languages only to sell more
- You only do pure programs that don't interact with the world
- You are a retard who doesn't understand the concept of ownership

Anything else?

Name: Anonymous 2015-04-24 18:49

If you try to return a closure, you may run into an error
This gives us these long, related errors
So we’d write this:
But we get another error
Right. Because we have a reference, we need to give it a lifetime
But we get another error
So what to do? This almost works
There’s just one last problem
With one last fix, we can make this work:
fn factory() -> Box<Fn(i32) -> i32> {
let num = 5;

Box::new(move |x| x + num)
}
let f = factory();

let answer = f(1);
assert_eq!(6, answer);

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List