comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » evaluation of logical expressions
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
evaluation of logical expressions [message #5083] Thu, 21 September 1995 00:00
Russ Welti is currently offline  Russ Welti
Messages: 27
Registered: October 1994
Junior Member
I've often wondered the reason why the following:

IDL> a=0
IDL> if a and b then print,'yes'
% Variable is undefined: B.
% Execution halted at: $MAIN$

Many languages stop evaluating logical expressions as soon
as the result can be determined. I'm sure there's a good
reason why IDL doesn't, but it means that in my code I
use a lot of these:

if n_elements(a) GT 0 then $
if a EQ 5 then $

where I *would* have liked to say:

if n_elements(a) GT 0 and a EQ 5 then $


Anybody know any background on this?
/
Russ Welti /-\
rwelti@u.washington.edu \-/
[Message index]
 
Read Message
Previous Topic: GIS: IDL vs. PV~WAVE
Next Topic: AVI to IDL conversion

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:26:53 PDT 2025

Total time taken to generate the page: 0.00404 seconds