Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!odi!benson From: benson@odi.com (Benson I. Margulies) Newsgroups: comp.lang.c++ Subject: Re: Problems maintaining header files Message-ID: <1991Feb5.180930.25723@odi.com> Date: 5 Feb 91 18:09:30 GMT References: <15917@reed.UUCP> <6107@stpstn.UUCP> <3707@lupine.NCD.COM> Reply-To: benson@odi.com (Benson I. Margulies) Organization: Object Design Inc., Burlington, MA Lines: 25 In article <3707@lupine.NCD.COM> rfg@NCD.COM (Ron Guilmette) writes: >In article <6107@stpstn.UUCP> lerman@stpstn.UUCP (Ken Lerman) writes: >> >>Objective-C (please hold the flames down to a dull roar) uses '#import >>' to mean the same thing as '#include ' except do >>nothing if the file has already been imported. This is MUCH nicer >>than '#pragma once' and might be a useful addition to C++. > >Contrary to Ken's misguided opinions, #import is *not* much nicer than >#pragma once. Quite the contrary, it is much stupider. > >Consider this. I have an include file which should only be included >at most one time during an entire compilation. If it gets included >more than once then I'll get errors. Give me any include file, and I believe that I can surround it with enough {} and #defines to make it safely includable a second time. It is a traditional unix vice to build things that only work one at a time. e.g. dbm. -- Benson I. Margulies