Right now if statements only has an if and end like.
if true
x = foo
end
It would be nice to also have the option to have bracket block style arguments if statements like.
if true {
x = foo
}
This would enable a more c style structure but would be more flexible.
I think it will conflict with the block argument to the calling method in the conditional.
if [1, 2, 3].any? { |x| x == 1 }
x = foo
end
I don't see any benefit from that. It would just be another way to do the same thing and we try to avoid that in Crystal. It's a purely stylistical issue. So I don't suppose this is worth pushing forward.
please don't
I was also going to comment about the syntax conflict. I don't think this will ever happen.
Most helpful comment
I don't see any benefit from that. It would just be another way to do the same thing and we try to avoid that in Crystal. It's a purely stylistical issue. So I don't suppose this is worth pushing forward.