No, it is no problem. Of course Go is not bound to match C's operators in any
case, but if they chose to be so bound, they could use "@" for the purpose. As
could, indeed, C or C++. I.e., those languages could also fix the problem, even at
this late date. They can be excused for not doing so, but Go cannot.
Posted Feb 4, 2010 18:25 UTC (Thu) by tjc (subscriber, #137)
[Link]
I agree, using '@' as an indirection operator would work. But it looks funny, especially as a postfix operator. I would probably get used to it.
I better like the idea of separating declaration syntax from expression syntax and using '*' as a postfix pointer declarator and '[]' as an infix[1] indirection operator, like this:
var p *[10]int;
var a [10]*int;
[p][0] = 1;
[a[0]] = 1;
I guess I could call this "square lisp" syntax. :)
[1] This really isn't infix, since the operand is infix, not the operator, but I don't know the correct term for this form.
Syntax flubs
Posted Feb 4, 2010 22:51 UTC (Thu) by anselm (subscriber, #2796)
[Link]
[1] This really isn't infix, since the operand is infix, not the operator,
but I don't know the correct term for this form.
Outfix?
Syntax flubs
Posted Feb 7, 2010 1:44 UTC (Sun) by tjc (subscriber, #137)
[Link]