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

Home » Public Forums » archive » 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 #53586 is a reply to message #53505] Wed, 18 April 2007 12:21 Go to previous messageGo to previous message
Carsten Lechte is currently offline  Carsten Lechte
Messages: 124
Registered: August 2006
Senior Member
F�LDY Lajos wrote:
> IDL> a[(a=2*findgen(10))]=1 & print, a
> 1.00000 2.00000 1.00000 6.00000 1.00000
> 10.0000 1.00000 14.0000 1.00000 1.00000

Isn't that what you would expect from in-place modification of an
array? At first, a[a[0]]==a[0] is set to 1, then a[a[1]]==a[2] is
set to 1, then a[a[2]]==a[1] is set to 1, not a[4], because a[2]
has been changed by a previous operation. a[a[3]]==a[6] is set to
1, also a[a[4]]==a[8], then IDL's rules regarding array subscripts
kick in and all the other subscripts cause a[9] to be set to 1.

The question is, should this kind of expression be illegal, or cause
a warning, or should the language define a less confusing behaviour?
Or at least be consistent across versions and platforms?


chl
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Oh No...
Next Topic: loop limit ???

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

Current Time: Sat Nov 29 13:18:01 PST 2025

Total time taken to generate the page: 1.04022 seconds