"C" wish list.

Peter da Silva peter at graffiti.UUCP
Wed Oct 23 21:23:18 AEST 1985


> >	2. Allow auto aggregate initialisations:
> 
> Already in X3J11.

Good. It'd be even better if I could get a copy of X3J11 to look at (hint).

> >	3. Allow constant aggregates:
> 
> It's really hard to come up with a complete syntax for this.  It's also
> of limited (although non-zero) usefulness.

So are enums, and they're there. I never understood why they bothered to
implement enums (which are more elegant than #defines, admittedly, but
don't really add any functionality) and structure assignment and passing
(can you say inefficient?) rather than some of the more obvious things
missing from 'C' (like function argument type checking... I know that's
there now but who's got a compiler that does it?).

As for the syntax: I added it to the small 'C' compiler as an exercise, and
found it rather easy. Of course I didn't have any data structures to worry
about... but...

	struct foo bar = {....}; /* initialised aggregates */
	...
	zot = (struct foo *){....}; /* constant aggregate of type struct foo */

And you can generate the same code you use to generate strings. It's a
straightforward extension of the current syntax. It makes the language
more orthogonal and less surprising.

> >	4. Allow true block structuring: [functions within functions]
> 
> Whatever for?  As opposed to reasonable non-block structuring as in Modula,
> I mean.

Because, once again, it's a straightforward extension of current syntax. Never
mind. I've already had "Why not" explained to me in great detail.

Question: doesn't anyone else have a wish-list of their own?
-- 
Name: Peter da Silva
Graphic: `-_-'
UUCP: ...!shell!{graffiti,baylor}!peter
IAEF: ...!kitty!baylor!peter



More information about the Comp.lang.c mailing list