ANSI C idea: structure literals

Karl Heuer karl at haddock.ISC.COM
Mon Mar 14 06:52:41 AEST 1988


In article <8803091705.AA09183 at explorer.dgp.toronto.edu> flaps at dgp.toronto.edu (Alan J Rosenthal) writes:
>I think it's clear that a new syntax, such as Karl Heuer's, is required.
>I would prefer a symbol rather than a keyword, but that's just me.

I'd prefer a less verbose syntax, too, but I can't think of anything that
isn't arbitrary and doesn't overload an existing syntax.

>(But: how about any of backquote, dollar, at (@), or right square bracket?
>Perhaps unary comma?  Perhaps if the `&' is immediately followed by an
>opening brace?)

Void the first three; I don't think we should add to the character set for
something this simple.  Unbalanced brackets would be a big headache (and
possibly an ambiguity; I wouldn't want to bet that this construct can never
appear inside brackets).  With unary comma, or ampersand-brace, where are you
going to put the type information?  And in the latter case, if you want the
aggregate itself rather than a pointer would you have to write `*&{...}`?

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint



More information about the Comp.lang.c mailing list