|
Re: Interpreter stack not aligned properly during user return. [message #38429 is a reply to message #38381] |
Mon, 08 March 2004 20:15   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Craig Markwardt writes:
>> The lesson is, of course, don't use unnecessary parentheses! To decide
>> which parentheses are actually necessary when using pointers, arrays, and
>> structures together, you could consult the operator precedence tutorial.
>
> ...or get addicted to crack cocaine. That seems easier and produces
> the same effect. :-)
That's what I was thinking, too, but I couldn't tell
if my eyes were blurring from tiredness or just the
effort to keep all those parentheses straight when
I had a pointer to a structure that had a pointer....
Oh, my God, I'm dizzy again!
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: Interpreter stack not aligned properly during user return. [message #38430 is a reply to message #38381] |
Mon, 08 March 2004 19:16   |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
JD Smith <jdsmith@as.arizona.edu> writes:
>
> The lesson is, of course, don't use unnecessary parentheses! To decide
> which parentheses are actually necessary when using pointers, arrays, and
> structures together, you could consult the operator precedence tutorial.
...or get addicted to crack cocaine. That seems easier and produces
the same effect. :-)
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|
Re: Interpreter stack not aligned properly during user return. [message #38432 is a reply to message #38381] |
Mon, 08 March 2004 12:17   |
JD Smith
Messages: 850 Registered: December 1999
|
Senior Member |
|
|
On Fri, 05 Mar 2004 10:56:06 -0700, David Fanning wrote:
> David Fanning writes:
>
>> I'll write this one down. It's worth remembering.
>
> Oh, I *had* this one written down already. (Probably why I
> vaguely remembered it.) It used to issue a different
> error message. It used to say "Temporary Variables Still
> Checked Out". Now it says, "Internal error: The Interpreter
> stack is not empty on exit."
>
> http://www.dfanning.com/code_tips/tempvar.html
>
> This message is *so* much better! :-)
The lesson is, of course, don't use unnecessary parentheses! To decide
which parentheses are actually necessary when using pointers, arrays, and
structures together, you could consult the operator precedence tutorial.
JD
|
|
|
|
|
|
Re: Interpreter stack not aligned properly during user return. [message #38569 is a reply to message #38381] |
Fri, 12 March 2004 18:28  |
Mark Hadfield
Messages: 783 Registered: May 1995
|
Senior Member |
|
|
Stein Vidar Hagfors Haugan wrote:
> Not to mention the *HORRIBLE* fact I discovered (the hard way) not too
> long ago, that IDL goes against all common sense putting AND and OR on
> equal footing wrt precedence:
I guess I am betraying my lack of commone sense here, but which of these
do you think *should* take precedence?
--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
|
|
|
Re: Interpreter stack not aligned properly during user return. [message #38580 is a reply to message #38381] |
Fri, 12 March 2004 12:45  |
Stein Vidar Hagfors H[2]
Messages: 28 Registered: October 2002
|
Junior Member |
|
|
Craig Markwardt <craigmnet@REMOVEcow.physics.wisc.edu> writes:
> Stein Vidar Hagfors Haugan <steinhh@astro.uio.no> writes:
>> .... That way, everybody would know that you'd better
>> put in every darn parenthesis that you *think* is superfluous.
>
> Except when extra parentheses cause misaligned stack errors. :-)
Well, at least you get an error message, not simply a quiet
calculation of the wrong result ;-)
--
------------------------------------------------------------ --------------
Stein Vidar Hagfors Haugan
ESA SOHO SOC/European Space Agency Science Operations Coordinator for SOHO
NASA Goddard Space Flight Center, Tel.: 1-301-286-9028
Mail Code 682.3, Bld. 26, Room G-1, Cell: 1-240-354-6066
Greenbelt, Maryland 20771, USA. Fax: 1-301-286-0264
------------------------------------------------------------ --------------
|
|
|
|
Re: Interpreter stack not aligned properly during user return. [message #38597 is a reply to message #38429] |
Fri, 12 March 2004 08:40  |
Stein Vidar Hagfors H[2]
Messages: 28 Registered: October 2002
|
Junior Member |
|
|
David Fanning <david@dfanning.com> writes:
> Craig Markwardt writes:
>
>>> The lesson is, of course, don't use unnecessary parentheses! To decide
>>> which parentheses are actually necessary when using pointers, arrays, and
>>> structures together, you could consult the operator precedence tutorial.
>>
>> ...or get addicted to crack cocaine. That seems easier and produces
>> the same effect. :-)
>
> That's what I was thinking, too, but I couldn't tell
> if my eyes were blurring from tiredness or just the
> effort to keep all those parentheses straight when
> I had a pointer to a structure that had a pointer....
>
> Oh, my God, I'm dizzy again!
Not to mention the *HORRIBLE* fact I discovered (the hard way) not too
long ago, that IDL goes against all common sense putting AND and OR on
equal footing wrt precedence:
IDL> print, 1 or 0 and 0
0
IDL> print, 1 or (0 and 0)
1
Yikes!!! I've used IDL for sooo many years, and heaven knows how many
statements of the form "a OR b AND c" there are in my programs,
causing unintended results! IMO they might as well abandon the whole
idea of operator precedence, switching to a clearly stated, randomized
evaluation approach. That way, everybody would know that you'd better
put in every darn parenthesis that you *think* is superfluous.
--
------------------------------------------------------------ --------------
Stein Vidar Hagfors Haugan
ESA SOHO SOC/European Space Agency Science Operations Coordinator for SOHO
NASA Goddard Space Flight Center, Tel.: 1-301-286-9028
Mail Code 682.3, Bld. 26, Room G-1, Cell: 1-240-354-6066
Greenbelt, Maryland 20771, USA. Fax: 1-301-286-0264
------------------------------------------------------------ --------------
|
|
|