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

Home » Public Forums » archive » buggy dictionary
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: buggy dictionary [message #91145 is a reply to message #91144] Tue, 09 June 2015 04:01 Go to previous messageGo to previous message
Lajos Foldy is currently offline  Lajos Foldy
Messages: 176
Registered: December 2011
Senior Member
On Tuesday, June 9, 2015 at 11:32:30 AM UTC+2, Helder wrote:
>
> a = dictionary('b',dictionary('c',findgen(10)))
> print, a.b['c',[1:-1]]
>
> However, as you pointed out, this delivers the wrong answer. Exelis acknowledged this (incident number 294397) and filed a bug report.
>
> So this will give a wrong answer:
> print, a.b['c',[1:-1]]

Here [1:-1] is not a subscript range, it is the colon operator for array creation (introduced in IDL 8.3):

IDL> x=[1:-1]
IDL> help, x & print, x
X INT = Array[3]
1 0 -1

So [1:-1] is actually an array subscript (with the usual array subscript clipping).

> but this will be ok:
> print, a.b.c[1:-1]

Here [1:-1] is a subscript range with a negative subscript value.

So the two [1:-1]'s have different meaning.

regards,
Lajos
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Multiple Processing
Next Topic: sort points clockwise or clounterclockwise

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

Current Time: Wed Oct 08 17:29:03 PDT 2025

Total time taken to generate the page: 0.00183 seconds