Re: 3.0.3

new topic     » goto parent     » topic index » view thread      » older message » newer message

Pete Lomax wrote:

> Derek Parnell wrote:
> > 
> > Jeremy Peterson wrote:
> > > 
> > > Juergen Luethje wrote:
> > > > 
> > > > global constant
> > > >    FALSE = 0,
> > > >    TRUE  = not FALSE
> > > Why not just
> > > 
> > > TRUE = 1 
> > 
> > Because it removes implementation dependancies.
> > It is generally accepted <snip> 'FALSE' is implemented as zero; some
> > implementations of 'TRUE', use 1, some -1, and some every non-zero value. 
> > By defining 'TRUE' as 'not FALSE' it will work with any implementation.
> 
> FWIW I prefer this, which I got from someone on this forum:
> }}}
<eucode>
> constant TRUE=(1=1),  -- for Eu, 1 (aka <>0)
>          FALSE=(1=0)  -- for Eu, 0
> </eucode>
{{{

> It is succinct and programming-language-independent.

<snip>

Cool. smile
In my code, TRUE also was language-independent, but FALSE wasn't.
The following combination of both ideas also is language-independent:
constant
   FALSE = (1=0),
   TRUE  = not FALSE


Regards,
   Juergen

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu