[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [OT] Re: import
From: |
Pascal Bourguignon |
Subject: |
Re: [OT] Re: import |
Date: |
Sat, 22 Dec 2001 01:47:02 +0100 (CET) |
Stan Shebs <shebs@apple.com> wrote:
>
> 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
Well, I'm beginning to believe that it's true that #import is bad,
while all the other import clauses in the other languages are good,
just because once more, it was badly done in CPP/C...
What would have been needed to avoid symlinks, relative paths and
multiples -I directives being a problem, like in other language, is a
"@import CLASSNAME;" directive (note the @).
But clearly we're far from it in the C family of languages...
On the other hand, I never had any problem using #import, working with
projects up to ~500 classes and 4 developers. Who did? Aren't those
problems just theorical?
--
__Pascal_Bourguignon__ (o_ Software patents are endangering
() ASCII ribbon against html email //\ the computer industry all around
/\ and Microsoft attachments. V_/ the world http://lpf.ai.mit.edu/
1962:DO20I=1.100 2001:my($f)=`fortune`; http://petition.eurolinux.org/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/IT d? s++:++(+++)>++ a C+++ UB+++L++++$S+X++++>$ P- L+++ E++ W++
N++ o-- K- w------ O- M++$ V PS+E++ Y++ PGP++ t+ 5? X+ R !tv b++(+)
DI+++ D++ G++ e+++ h+(++) r? y---? UF++++
------END GEEK CODE BLOCK------
- omni frameworks (was: 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, 2001/12/21
- Re: [OT] Re: import,
Pascal Bourguignon <=
- 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
RE: GNUStep: An Apology for Announcing Donation of Proprietary Software to the Project, Scott Francis, 2001/12/21