home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!secapl!Cookie!frank
- From: frank@Cookie.secapl.com (Frank Adams)
- Subject: Re: Idempotent header file proposal
- Message-ID: <1992Nov23.154049.81707@Cookie.secapl.com>
- Date: Mon, 23 Nov 1992 15:40:49 GMT
- References: <1992Nov20.010009.24900@taumet.com> <1992Nov21.175456.119915@Cookie.secapl.com> <1992Nov22.173734.2042@taumet.com>
- Organization: Security APL, Inc.
- Lines: 39
-
- In article <1992Nov22.173734.2042@taumet.com> steve@taumet.com (Steve Clamage) writes:
- >frank@Cookie.secapl.com (Frank Adams) writes:
- >>In article <1992Nov20.010009.24900@taumet.com> steve@taumet.com (Steve Clamage) writes:
- >>>nh@cbnewsg.cb.att.com (nicholas.hounsome) writes:
- >>>>Can we not have a standard pragma to say that a header file is idempotent
- >>>
- >>>This solves a problem outside the language, and for that reason is
- >>>probably not appropriate to put in the language Standard. [...]
- >
- >>This is a generic problem; it
- >>does *not* apply only to some systems. So a standard is appropriate; but if
- >>it is neither to be a language standard nor a standard pragma, how is it to
- >>be done?
- >
- >Some compilers are very slow. How about a standard pragma "#pragma fast"
- >which would direct the compiler to compile more quickly if it could.
- >Some compilers require too much memory at compile time. How about a
- >standard pragma "#pragma small" which would direct the compiler to use
- >less memory if it could. If the compiler could not comply, it would
- >ignore these pragmas.
- >
- >I hope these suggestions sound silly to you. These, along with the
- >repeated include file problem, are not C++ (or C) language problems.
- >They are "quality of implemenation" issues.
-
- I can't agree. Whether I want an include file inserted only the first time
- it is seen, or every time, is part of the specification of the program.
- Inserting #if !defined ... #endif around the body of the file is already a
- kludge. One can make a compiler which deals with this kludge better; this
- is indeed a quality of implementation issue.
-
- But it is not a quality of implementation issue to ask for the feature I and
- a lot of other people really want, instead of a kludge to get around its
- absence.
-
- Based on this, it would seem that a pragma is the wrong way to go. I would
- suggest #once. (#idempotent suggests that including the file more than once
- is the same as including it once. But if we take out the #if[ndef] hack,
- this is no longer the case.)
-