Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Rust:

    if foo.validate() {
        println!("{} is the right answer", foo);
    }
This has less parentheses (unless you count the placeholder in the format string). Putting the condition in parentheses like C and friends do is redundant if you use braces for the block anyway.


less parentheses, but not less bracket-like characters. If you count parens and curlies, it is exactly the same. Yours has 4 parens and 2 curlies (not including the format string), and the original lisp code has 6 parens.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: