News for hackers. Stuff that matters.
Re:A taste of Rust by lobster_johnson on Thursday April 25, 2013 @12:56PM (#5608321)
I prefer Ruby's approach, which is not whitespace-sensitive, but has a very liberal approach to where expressions end.

The general rule is, as with Python and Go, that open braces, brackets, parens or quotes have precedence; and operators or punctuation at the end of a line will continue to the next line.

In addition, there are some complicated parsing internals -- not just for expression-ending sensing, but also for supporting parens-less method calls -- that endow the parser with some compiler knowledge about what tokens are variables and what tokens are methods. In other words, the parser has information that violates the parser/compiler separation of concerns, but it works really well in practice.

The only time I ever use \ in Ruby is for string literals that need to be broken up for readability:

    my_string = "This is a very long string that" \
      " must be wrapped."
You can use + or <<, but this will be evaluated at runtime, whereas \ results in a single string allocation.

Of course, Ruby requires "end" for a lot of constructs, but it could have just as well have used braces.

Re:A taste of Rust by gnaritas on Thursday April 25, 2013 @11:01PM (#5611265)
Ruby can use braces instead of end, both are valid.
Re:A taste of Rust by lobster_johnson on Friday April 26, 2013 @01:27AM (#5611632)
Hm? Only for blocks. Not classes, methods, if/unless, while or begin/rescue.
Re:A taste of Rust by gnaritas on Friday April 26, 2013 @10:25AM (#5613066)
Dang, you're right, I could swear otherwise but yup, just on blocks.