• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: usage of #import?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: usage of #import?


  • Subject: Re: usage of #import?
  • From: Keith Ray <email@hidden>
  • Date: Tue, 12 Nov 2002 10:16:11 -0800

On Monday, November 11, 2002, at 01:43 PM, Don Yacktman wrote:

On Sunday, November 10, 2002, at 03:30 AM, Philippe C.D. Robert wrote:
Hi Wilfredo,

I do not exactly know the official reasoning from the FSF against the usage of this feature, but as Stan points out in his email there are indeed some valid reasons for not using it in ObjC code (in some circumstances):

http://mail.gnu.org/pipermail/discuss-gnustep/2001-October/013735.html

In over 10 years of using Objective-C in a variety of different environments, I have never once seen any of these theoretical problems with #import actually happen even once. So in practice, for Objective-C at least, it is not a problem.

The argument
The problem is that it requires a notion of file identity, so it can know
to avoid including the "same" file more than once.
is specious. The compiler DOES know each and every file it includes, and can tell the difference between "file.h" and "framework/file.h" (it should in fact keep track of the file's pathname or fileid). I have been using
#pragma once
with several compilers, and it effectively does the same thing.


--
C. Keith Ray
<http://homepage.mac.com/keithray/xpminifaq.html>
<http://homepage.mac.com/keithray/resume.html>
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: usage of #import? (From: Don Yacktman <email@hidden>)

  • Prev by Date: FinderInfo
  • Next by Date: Re: [Bug?] Text rendering under Cocoa
  • Previous by thread: Re: usage of #import?
  • Next by thread: shared PrintInfo
  • Index(es):
    • Date
    • Thread