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 #91130 is a reply to message #91129] Mon, 08 June 2015 07:15 Go to previous messageGo to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Monday, June 8, 2015 at 4:08:30 PM UTC+2, Helder wrote:
> Hi,
> I've just encountered another bug using dictionaries.
>
> This is ok:
> IDL> a = dictionary('b',findgen(10))
> IDL> print, a['b',1:-1]
> 1.00000 2.00000 3.00000 4.00000 5.00000 6.00000 7.00000 8.00000 9.00000
>
> Doing the same, but inside an object (that being self.a['b',1:-1]) will make the IDLDE crash "hard" (=window closes without warning).
> Here is an example:
>
> pro testObjBug::testIt
> print, self.aa['b',1:-1] ;this makes IDL crash
> end
>
> function testObjBug::init
> self.aa = dictionary('b',findgen(10))
> return, 1
> end
>
> pro testObjBug__define
> class = {testObjBug,$
> aa:obj_new()}
> end
>
> pro testObjBug
> o = obj_new('testObjBug')
> o->testIt
> end
>
> The only way around this is to copy the variable out of the object:
> aa = self.aa['b']
> print, aa[2:-2]
>
> Cheers,
> Helder
>
> PS: I've submitted this to IDL. It's logged with incident nr 294397.

Sorry, but I just managed to make a much shorter example of this bug. Please save everything before trying it!

IDL> a = dictionary('b',dictionary('c',findgen(10)))
IDL> a.b['c',1:-1]

... bye bye IDL

Notice that this works:
IDL> a.b['c',1:9]
1.0000000 2.0000000 3.0000000 4.0000000 5.0000000 6.0000000 7.0000000 8.0000000 9.0000000

But anything with the '-' after the ':' doesn't.

Cheers,
Helder
[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: Fri Oct 10 11:42:57 PDT 2025

Total time taken to generate the page: 1.51532 seconds