[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [OT] Re: import
From: |
Stan Shebs |
Subject: |
Re: [OT] Re: import |
Date: |
Fri, 21 Dec 2001 16:19:35 -0800 |
Pascal Bourguignon wrote:
>
> The #import CPP directive is defined as including a given file once
> ever in a compilation run, and that's enough to be an improvement to
> #include.
You're casually assuming that "a given file" is a well-defined
concept. In the presence of symlinks, relative paths, and multiple
-I directives on the command line, that's just not true. In fact,
correct implementation of #import requires looking at inodes to
verify identity, which is not portable because inodes are a Unix
thing. (I have a patch in Apple's GCC that does this for some
pathological cases that occur in OS X code, needs to be cleaned
up for FSF submission still.)
I think what happened with #import is that it was originally intended
to be a genuine interface-loading construct, but somewhere along the
way it got turned into an intelligent #include. #import <classname>
wouldn't have the file identity issue of #import <filename>, because
there is only one global space of classes, and behind the scenes you
could have a database of classes for the compiler to look in. Alas,
although everybody pays lip service to the idea that each #imported
.h corresponds exactly to a single class interface, in practice lots
of non-class bits get slipped in, and so we're back to being just a
dialect of C, with #import being like #include, but flakier.
Stan
- Re: "external" frameworks (was: Re: GNUStep: An Apology for Announcing Donation of Proprietary Software to the Project), (continued)
- Re: "external" frameworks, Pedro Ivo Andrade Tavares, 2001/12/22
- Re: "external" frameworks, Chris B . Vetter, 2001/12/26
- Re: "external" frameworks, Pedro Ivo Andrade Tavares, 2001/12/27
- Re: import, David Golden, 2001/12/21
- [OT] Re: import, Pascal Bourguignon, 2001/12/21
- Re: import, Nicola Pero, 2001/12/21
- [OT] Re: import, Pascal Bourguignon, 2001/12/21
- Re: [OT] Re: import,
Stan Shebs <=
- Re: [OT] Re: import, Pascal Bourguignon, 2001/12/21
- Re: [OT] Re: import, Jonathan B. Leffert, 2001/12/21
- Re: [OT] Re: import, Nicola Pero, 2001/12/21
- Re: [OT] Re: import, Jeff Teunissen, 2001/12/22
- Re: GNUStep: An Apology for Announcing Donation of ProprietarySoftware to the Project, Fred Kiefer, 2001/12/21
- RE: GNUStep: An Apology for Announcing Donation of ProprietarySoftware to the Project, Scott Francis, 2001/12/21
- Re: GNUStep: An Apology for Announcing Donation of ProprietarySoftware to the Project, Philippe C.D. Robert, 2001/12/22
- Re: GNUStep: An Apology for Announcing Donation of ProprietarySoftware to the Project, JW, 2001/12/22
- Re: GNUStep: An Apology for Announcing Donation of ProprietarySoftware to the Project, Jeff Teunissen, 2001/12/22
Re: GNUStep: An Apology for Announcing Donation of Proprietary Software to the Project, Adam Fedor, 2001/12/21