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

Home » Public Forums » archive » Re: Oh No...
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: Oh No... [message #53501 is a reply to message #53500] Wed, 18 April 2007 06:04 Go to previous messageGo to previous message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
On Wed, 18 Apr 2007, Paolo Grigis wrote:

>
> Speaking of which, what about
>
> IDL> delvar,a ;undefines a
> IDL> a[(a=2*findgen(10))]=1 ;agreed, this is a bit crazy, but hold on
> IDL> print,a
> 1.00000 1.00000 1.00000 6.00000 8.00000
> 10.0000 1.00000
> 14.0000 1.00000 1.00000
>
> Now, this must be a bug, surely... (or a very strange feature indeed).
>

No, invalid code, with undefined result :-)

We have no formal definition of the IDL syntax, but there is a rule in
Fortran/C/C++/... which should be true for IDL, too: a memory cell can
be modified at most once in an expression. You are modifying 'a' twice
in a single expression.

(Section 6.5#2 of the C99 specification: "Between the previous and next
sequence point an object shall have its stored value modified at most once
by the evaluation of an expression. Furthermore, the prior value shall be
accessed only to determine the value to be stored.")

regards,
lajos
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Text in plots
Next Topic: Oh No...

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

Current Time: Sat Oct 11 09:06:29 PDT 2025

Total time taken to generate the page: 0.00675 seconds