-
-
Save huonw/5683000 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let args = os::args(); | |
match args.tail() { | |
[~"-n",..strs] => print(str::connect(strs, " ")), | |
strs => println(str::connect(strs, " ")), | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// typing str::connect twice is too much | |
fn main() { | |
let args = os::args(); | |
let (func,strs) = match args.tail() { | |
[~"-n",..strs] => (print, strs), | |
strs => (println, strs) | |
}; | |
func(str::connect(strs, " ")) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment