1. Short circuit warning error

The line

	if id=Main or getFocus()=0 or id!=getParentWindow(getFocus()) then

issues a warning message that getFocus() might be short circuited, but

	if getFocus()=0 or id=Main or id!=getParentWindow(getFocus()) then

does not. Personally, I'd like to see short circuit warning messages
removed completely, but failing that at least make them correct.

Regards,
Pete

new topic     » topic index » view message » categorize

2. Re: Short circuit warning error

Pete Lomax wrote:
> The line
> 
> 	if id=Main or getFocus()=0 or id!=getParentWindow(getFocus()) then
> 
> issues a warning message that getFocus() might be short circuited, but
> 
> 	if getFocus()=0 or id=Main or id!=getParentWindow(getFocus()) then
> 
> does not. Personally, I'd like to see short circuit warning messages
> removed completely, but failing that at least make them correct.

In your second line, with left-to-right evaluation, getFocus() 
will always be called, so there is no need for a short-circuit warning, 
at least for the first instance of getFocus(). However getFocus() is 
called again near the end of the line, and Euphoria should
warn about that call. It looks like Euphoria is not smart enough to 
warn about short-circuited nested calls. I'll take a look at it.

This warning was introduced a long time ago, when
short-circuit evaluation was added. The main idea was to
catch places in old code where short-circuiting could
cause the code to "break". Not many cases of actual breakage
were ever found, but I think the warning is still useful.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

3. Re: Short circuit warning error

On Mon, 25 Apr 2005 18:03:27 -0700, Robert Craig
<guest at RapidEuphoria.com> wrote:

>It looks like Euphoria is not smart enough to 
>warn about short-circuited nested calls. I'll take a look at it.
Shit. You didn't take the bait. blink)
>
>This warning was introduced a long time ago,
>Not many cases of actual breakage were ever found
Exactly. Just take it out. It is a waste of time, and damn annoying to
boot. You've explained it properly in the docs, let it go.

Does anyone want this warning to remain?

I could argue that:

	if i>=0 and a[i] then

should therefore generate:

	warning: negative and zero values of i will not crash.

It would be just as useful.

Regards,
Pete

new topic     » goto parent     » topic index » view message » categorize

4. Re: Short circuit warning error

Pete Lomax wrote:
> 
> On Mon, 25 Apr 2005 18:03:27 -0700, Robert Craig
> <guest at RapidEuphoria.com> wrote:
> 
> >It looks like Euphoria is not smart enough to 
> >warn about short-circuited nested calls. I'll take a look at it.
> Shit. You didn't take the bait. blink)
> >
> >This warning was introduced a long time ago,
> >Not many cases of actual breakage were ever found
> Exactly. Just take it out. It is a waste of time, and damn annoying to
> boot. You've explained it properly in the docs, let it go.
> 
> Does anyone want this warning to remain?
> 
> I could argue that:
> 
> 	if i>=0 and a[i] then
> 
> should therefore generate:
> 
> 	warning: negative and zero values of i will not crash.
> 
> It would be just as useful.
> 
> Regards,
> Pete

Subscripting a value of zero will always generate a warning in your example.

And I do not see how your message would be just as useful.  The short circuiting
message is more useful because it's easy to forget about the rule, making it
tougher to debug when you are expecting a side effect.

Maybe different levels of 'without warning' would be better... maybe even have a
level that allows parameters (e.g. for event handlers) to be unused.

-- Brian

new topic     » goto parent     » topic index » view message » categorize

5. Re: Short circuit warning error

>This warning was introduced a long time ago,
>Not many cases of actual breakage were ever found
>Exactly. Just take it out. It is a waste of time, and damn annoying to
>boot. You've explained it properly in the docs, let it go.

I agree take it out it is a pain !!!
and is not worth it's annoyance !!

Bernie

My files in archive:
w32engin.ew mixedlib.e eu_engin.e win32eru.ew

Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu