[Gambas-user] strange problem with NOT

Jim Ward zjimward at ...626...
Wed Mar 23 19:13:54 CET 2005


I did some checking and found the following when running this code
snippet in  PowerBASIC. (My BASIC of choice when I have to be stuck
with Windows.) The result was:

x = 1
NOT x = 0 returned TRUE
NOT (x = 0) returned TRUE

x = 0
x = 0 returned TRUE



On Tue, 22 Mar 2005 10:56:11 +0100, Benoit Minisini
<gambas at ...1...> wrote:
> On Tuesday 22 March 2005 04:15, Jean-Francois Perreault wrote:
> > Rob wrote:
> > >On Monday 21 March 2005 15:10, Jean-Francois Perreault wrote:
> > >>IF (b <> 0) AND (c > d) THEN
> > >>then both expression are evaluated before the AND , causing a
> > >>performance penalty
> > >
> > >Are you sure it has to be that way?  I'm pretty sure Perl's short
> > >circuiting, when confronted with
> > >
> > >if (($b != 0) && ($c > $d)) {
> > >
> > >would evaluate "$b != 0" and then stop if it were false.
> > >
> > >Rob
> >
> > I haven't tried , but I'd guess that no , unless it's a hack because ()
> > has the highest priority , even over + and -
> >
> > but does gambas implement short circuiting
> 
> No. But this is planned. Read the TODO file!
> 
> > and expression evaluation
> > re-ordering optimisations ?
> 
> No optimization of expressions.
> 
> --
> Benoit Minisini
> mailto:gambas at ...1...
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>




More information about the User mailing list