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

rust just got 4x more productive [shill thread]

Name: Anonymous 2016-12-16 15:09

Rust designers developed an idiom for concisely propagating errors outwards with a macro called try!:
let file = try!(File::open("file.txt"));
More recently, Rust shipped an even more concise notation for error propagation, the postfix ? operator:
let file = File::open("file.txt")?;

Name: Anonymous 2016-12-31 23:12

>>24
A lot situations only work with nullable pointers, like linked list nodes for example (technically, you could implement a node struct with a non-nullable pointer and instead have a boolean nextNodeExists member to determine if the pointer can be legally dereferences, but that seems pretty wasteful IMHO). And you can already emulate non-nullable pointers in C++ with references.

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