Path: utzoo!mnetor!uunet!husc6!mailrus!nrl-cmf!cmcl2!brl-adm!adm!MAILER%ALASKA.BITNET@CUNYVM.CUNY.EDU From: MAILER%ALASKA.BITNET@CUNYVM.CUNY.EDU Newsgroups: comp.lang.c Subject: Undelivered mail Message-ID: <12343@brl-adm.ARPA> Date: 13 Mar 88 05:06:02 GMT Sender: news@brl-adm.ARPA Lines: 47 Subject: Re: ANSI C idea: structure literals (and short constants) [Non-Deliverable: User does not exist or has never logged on] Reply-To: Info-C@BRL.ARPA Received: From UWAVM(MAILER) by ALASKA with Jnet id 9636 for SXJVK@ALASKA; Sat, 12 Mar 88 19:31 AST Received: by UWAVM (Mailer X1.25) id 6173; Sat, 12 Mar 88 20:31:21 PST Date: Sat, 12 Mar 88 07:06:28 GMT Reply-To: Info-C@BRL.ARPA Sender: Info-C List From: Peter da Silva Subject: Re: ANSI C idea: structure literals (and short constants) Comments: To: info-c@BRL-SMOKE.arpa To: Vic Kapella 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*.