LWN.net Logo

Syntax flubs

Syntax flubs

Posted Feb 4, 2010 18:25 UTC (Thu) by tjc (subscriber, #137)
In reply to: Syntax flubs by ncm
Parent article: GCC to merge Go support

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.


(Log in to post comments)

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]

Outfix?
You are indeed correct!

http://www.abstractmath.org/MM/MMFunctionValue.htm#_Toc223234910

It seems obvious in retrospect. Thanks.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds