Re: request for source change

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

Bernie Ryan wrote:
> 
> 
> How about doing away with the short-circuit warning message.
> The warning is a pain in the neck.
> Why should a user have to :
> 1. Rewrite their code.
> 2. Place without warning around their code.
> Please don't suggest placing without warning at the top of my program.
> 
> After all short-circuit code is not a bad programming practice and
> some times is desired.
> 
> At least you could have a without short_circuit_warning option.

Just get rid of it. This utterly pointless and extremely annoying warning does
not even work properly anyway:
integer id id=0
function f() id=3 return id end function
function g(integer i) return i end function
    if id or f()=0 then end if
    if id or g(0) then end if
    if id or g(f()) then end if

You only get a warning on the first if statement, and none if you comment that
one line out, despite the fact that the self same f() can just as easily be
short-circuited on the third if statement. Which as I have also pointed out is
NOT to be taken as encouragement to make matters worse.

Anyway, it looks pretty easy to remove, ~line 442 in parser.e

Regards
Pete

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

Search



Quick Links

User menu

Not signed in.

Misc Menu