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

Home » Public Forums » archive » Re: Order of argument evaluation (Was: Re: making a checkerboard array?)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Order of argument evaluation (Was: Re: making a checkerboard array?) [message #56008 is a reply to message #55990] Wed, 26 September 2007 07:39 Go to previous messageGo to previous message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
On Wed, 26 Sep 2007, pgrigis@gmail.com wrote:

> Allan Whiteford wrote:
>> [...]
>>
>> IDL> ((a=fltarr(3)))[1]=10
>> IDL> print,a
>> 0.00000 10.0000 0.00000
>>
>
> I guess a danger signal would be appropriate
> near such statements, after all this can quickly
> get out of control ;-)
>
> IDL> delvar,c
> IDL> c[(c=[0,1])]=(c=[1,2,3])
> IDL> print,c
> 1 1 3
>

In C/C++/Fortran/... there is a rule that a memory cell can be changed at
most once in a statement, otherwise the result is undefined (and so
different implementations can create different results without violating
the standard). I guess a similar rule is in effect in IDL, too.

These examples give syntax error prior IDL 6.0:

IDL> print, !version
{ sparc sunos unix 5.3 Nov 11 1999}
IDL> ((a=fltarr(3)))[1]=10 & print, a
% Expression must be named variable in this context: <FLOAT Array[3]>.
% Execution halted at: $MAIN$
IDL>


regards,
lajos
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: create geotiff
Next Topic: Re: selection box in widget program

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

Current Time: Fri Oct 10 23:55:50 PDT 2025

Total time taken to generate the page: 0.23707 seconds