Logo

Programming-Idioms

History of Idiom 3 > diff from v3 to v4

Edit summary for version 4 by :

Version 3

2015-08-18, 15:45:45

Version 4

2015-08-19, 16:18:44

Idiom #3 Create a procedure

Like a function which doesn't return any value, thus has only side effects (e.g. Print to standard output)

Idiom #3 Create a procedure

Like a function which doesn't return any value, thus has only side effects (e.g. Print to standard output)

Code
fn finish(name : &str) { println!("My job here is done. Goodbye {}", name); }
Code
fn finish(name : &str) {
    println!("My job here is done. Goodbye {}", name);
}
Comments bubble
The actual return type is Unit, typed '()' and can be ommited from function signature.
Comments bubble
The actual return type is Unit, typed '()' and can be ommited from function signature.
Demo URL
http://is.gd/KqExyU