I realize that Brat owes a lot to Smalltalk, so I was looking over the Smalltalk wikipedia page.
I noticed that the syntax for blocks (functions) looked like this:
[ :param | ... ]
That made me think about Brat’s function syntax, which looked like this:
{ | param | ... }
Why is the Brat syntax like that? Well, because I am used to Ruby, where that is what blocks look like. But I noticed something. In Ruby, there are two vertical bars around the parameters. Why? I assume because of parsing issues, especially when you consider that curly braces are also used for hash literals. But, in Brat, square braces are used for arrays and hashes, curly braces are only used for functions. That means the first vertical bar is completely superfluous!
So I changed it to look more like Smalltalk, thereby saving a character and reducing syntactic clutter:
{ param | ... }
It does look a little unbalanced to me, with only that one vertical bar there, but I think that is just because I am used to reading Ruby. I am sure it will grow on me.
Note: This does introduce some ambiguity when you consider that ’|’ can also be a binary operator. In the situation where this could be ambiguous, the formal parameter interpretation has higher priority.
number.| = {rhs| my + rhs }
x = 1
f1 = { 1 | x } #this is not ambiguous, numbers cannot be formal parameters
p f1 #=> 2
f2 = { x | x }
p f2 5 #=> 5
f3 = {| x | x }
p f3 #=> 2

