Path: utzoo!mnetor!uunet!nuchat!uhnix1!sugar!peter From: peter@sugar.UUCP (Peter da Silva) Newsgroups: comp.lang.c Subject: Re: ANSI C idea: structure literals (and short constants) Message-ID: <1559@sugar.UUCP> Date: 12 Mar 88 07:06:28 GMT References: <2743@mmintl.UUCP>, <2550052@hpisod2.HP.COM> <1988Mar6.033210.1309@utzoo.uucp> Organization: Sugar Land UNIX - Houston, TX Lines: 30 Summary: Prior art for aggregate constants. In article ... henry@utzoo.uucp (Henry Spencer) writes: > foo = { ... }; > It is agreed that the latter form is more convenient. But we were talking > about *needs*, in the context of an existing language, not about a wishlist > for a new language. I implemented just this construct in a copy of the Small-C compiler I was playing around with about 6 years ago. I had just picked up a copy of the BCPL book and wanted to play with the concepts. I also implemented this: foo = { for(i = 0; i < 10; i++) if(...) break; i; }; in analogy to the BCPL: foo = $( ... resultis i; $) Back to the subject.. the problem of what type an aggregate constant is is a lot easier in Small-C. It's only got 4 types. But if you need prior art to consider this, well here's two examples (half-smiley). > way to do it is probably the GNU compiler's approach, which avoids this > hideous botch entirely. What's the GNU compiler's approach? -- -- Peter da Silva `-_-' ...!hoptoad!academ!uhnix1!sugar!peter -- Disclaimer: These U aren't mere opinions... these are *values*.