From ... From: Erik Naggum Subject: Re: defvar and (declaim (special ...)) Date: 1999/04/10 Message-ID: <3132775216232302@naggum.no>#1/1 X-Deja-AN: 464933340 References: <7eoaqg$399$1@nnrp1.dejanews.com> mail-copies-to: never Organization: Naggum Software; +47 8800 8879; http://www.naggum.no Newsgroups: comp.lang.lisp * Kent M Pitman | I think C .h files and the idea of multiple declarations are an | abomination. C should get all the deserved heat it can get, but in this case, it's less ugly than it appears to be. there can be only one declaration of any object, and only one definition in the appropriate scope. multiple instances of each is an error. however, you don't have to declare something, because the definition will itself declare it if it was undeclared, and the definition doesn't have to be found in the same compilation unit, only the declaration if there are references. the old K&R C definition was pretty relaxed about these things, but ANSI and ISO cleaned up this mess. all of this in C is to support separate compilation of files with a completely ignorant compiler that produces object files that contain nothing but the bare essentials to build "executables". no other language is able to survive at this level of pandemic ignorance, and various harsh measures are required to cope with the compiler/linker relationship in C and consequently under Unix, such as many output files from the compiler and the danger of loss of synchronization between these files, so there's no doubt they have serious problems, but it isn't because of multiple declarations as far as the compiler sees it. well-written C also keeps declarations in header files and definitions in source files, so there should actually be only one decleration of each object, anyway. #:Erik