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

Home » Public Forums » archive » Re: HASH makes too many temporaries
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: HASH makes too many temporaries [message #83590 is a reply to message #83585] Tue, 19 March 2013 01:55 Go to previous message
markb77 is currently offline  markb77
Messages: 217
Registered: July 2006
Senior Member
I would add to this that it is impossible to distinguish between
scalars and arrays of HASH or LIST variables using the normal SIZE or
ISA(/ARRAY) commands, as illustrated in the code below. Still waiting
to hear from ITTVIS on the proper way to do this. Having to check the
TYPENAME seems backwards.

pro test

a = hash('first', 1, 'second', 2)
b = hash('third', 3, 'fourth', 4, 'fifth', 5)

print, 'Output of SIZE() for a HASH varible:'
print, size(a, /STRUCTURE)

c = [a,b]
print, 'Output of SIZE() for an array of HASHes:'
print, size(c, /STRUCTURE)

print, 'Output of ISA(/ARRAY) for scalar hash:'
print, isa(a, /array)

print, 'Output of ISA(/ARRAY) for array of hashes:'
print, isa(c, /array)

help, a, output=ahelp
help, c, output=chelp

print, 'HELP for scalar hash:'
print, ahelp

print, 'HELP for array of hashes:'
print, chelp

print, 'TYPENAME for scalar hash:', typename(a)
print, 'TYPENAME for array of hashes:', typename(c)

end

Output of SIZE() for a HASH varible:
{ OBJREF 11 0 0 2
1 2 0 0 0
0 0 0 0
}

Output of SIZE() for an array of HASHes:
{ OBJREF 11 0 0 2
1 2 0 0 0
0 0 0 0
}

Output of ISA(/ARRAY) for scalar hash:
1

Output of ISA(/ARRAY) for array of hashes:
1

HELP for scalar hash:
A HASH <ID=1 NELEMENTS=2>

HELP for array of hashes:
C OBJREF = Array[2]

TYPENAME for scalar hash:HASH

TYPENAME for array of hashes:OBJREF
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: MGlib IDL library
Next Topic: Re: cgPlotS and cgColorBar issues

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

Current Time: Fri Oct 10 07:07:47 PDT 2025

Total time taken to generate the page: 0.31857 seconds