Richard M. Hartman <[EMAIL PROTECTED]> wrote:
> I've always thought that the
> definitions for "define" and "declare" should have been the
> other way 'round.

These words were this way around in the English language long before
these stinking 'puters came about...

> nobody ever talks about "definining"
> local variables in a function -- they talk about "declaring" them,

Actually I've heard the former, but agree that the latter is more
common.  I suspect this is a holdover from earlier times when the words
were interchangable (for example, "standard" Pascal had no equivalent
to C's declarations), and the point was not that there was a difference
between defining and declaring, but that you had to define/declare your
variables *at all* rather than them just springing into existence when
used (c.f., Fortran, BASIC).

Later on (in languages with separate compilation, and hence more
widespread _forward declarations_), there was a need for the two separate
concepts that C calls definition and declaration.  Once you've chosen
these two words to be used, I think the meanings in C match their common
English meanings very well.

Incidentally, I've been having an interesting conversation with Mike
Davis about why he didn't get the problems that Sam was having.  Here's
another useful reference, this time to the ANSI C Rationale:

        http://www.lysator.liu.se/c/rat/c1.html#3-1-2-2

It seems that Sam's compiler adheres to the strict ISO C model and gives
"redefined variable" errors, while Mike can get away with using the same
code because GCC allows the "relaxed ref/def" model.

    John  "sounds like a job for alt.folklore.computers to me"

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to