Undelivered mail

MAILER%ALASKA.BITNET at CUNYVM.CUNY.EDU MAILER%ALASKA.BITNET at CUNYVM.CUNY.EDU
Sun Mar 13 15:06:02 AEST 1988


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 at BRL.ARPA

Received: From UWAVM(MAILER) by ALASKA with Jnet id 9636
          for SXJVK at 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 at BRL.ARPA
Sender:       Info-C List <INFO-C at NDSUVM1>
From:         Peter da Silva <peter at sugar.uucp>
Subject:      Re: ANSI C idea: structure literals (and short constants)
Comments: To: info-c at BRL-SMOKE.arpa
To:           Vic Kapella <SXJVK at ALASKA>

In article ... henry at 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*.



More information about the Comp.lang.c mailing list