Re: ESL Master Include File
Pete Lomax wrote:
>
> On Mon, 25 Jul 2005 12:17:40 -0700, "D. Newhall"
> <guest at RapidEuphoria.com> wrote:
>
> >the programmer might want to make FALSE = -1
> such programmers should be shot on sight.
>
> Pete
Arguably, but is that not one of the primary uses of constants? If Rob decided
to change the end-of-file designator from -1 to 0 then all the code written that
uses -1 hardcoded in all the checks for end-of-file would have to be searched and
then tested to make sure that the -1 check in the main loop wasn't for something
else. However, if the coder used a constant named EOF or something to represet
the end-of-file designator then all they'd have to change would be the line that
says "constant EOF = -1" to "constant EOF = 0".
I've used a constant named FALSE that was set to -1 in a file before. It was a
logical inference tool that used 1 for TRUE, 0 for UNDEF, and 0 for FALSE.
|
Not Categorized, Please Help
|
|