

Ruby Block Styling (Homoiconic/Reg Braithewaite) - angelbob
http://github.com/raganwald/homoiconic/blob/master/2009-12-09/block_styling.markdown#readme

======
raganwald
Ok, I was surprised to see this submitted to HN. In an effort to drag it into
something that gratifies my intellectual curiosity, forget what does or
doesn't work in Ruby for a moment and ask a question:

 _Why doesn't this work in every language?_

In other words, if you have a construct for sequencing multiple statements
(line breaks and semicolons in Ruby), and another construct for altering the
order of evaluation (parentheses in Ruby and most languages), why don't they
work together seamlessly? The surprising thing here is not that Ruby allows
it, but that many other popular languages don't.

~~~
k4st
You can do it in C:

    
    
        #include <stdio.h>
        int main(void) {
            int a, b, c;
            int d = (a = 1, b = 2, c = 3, a + b + c);
            int e = (({int f = 1; e = f;}), e += 1);
        
            printf("d is %d \n", d);
            printf("e is %d \n", e);
        
            return 0;
        }
    

Edit: I just realized how strange the line e = ... is. I wonder if it yields
different results with different compilers.

