Re: Storing !NULL in struct [message #83605 is a reply to message #83531] |
Mon, 18 March 2013 05:20   |
lecacheux.alain
Messages: 325 Registered: January 2008
|
Senior Member |
|
|
Le lundi 18 mars 2013 12:41:14 UTC+1, Tom Grydeland a écrit :
> On Monday, March 18, 2013 9:27:31 AM UTC, alx wrote:
>
>
>
>> Le lundi 18 mars 2013 10:00:58 UTC+1, Tom Grydeland a écrit :
>
>>> Either of HASH or LIST would be perfectly fine, if I were able to even assign to already-known fields of structs stored inside them:
>
>
>
>>> It's not that I cannot imagine a way of working around this, but it seems to defeat the purpose of providing high-level data structures.
>
>
>
>> IDL> h = hash('f', {t:0})
>
>> IDL> help, h
>
>> H HASH <ID=1 NELEMENTS=1>
>
>> IDL> print, h['f'].t
>
>> 0
>
>> IDL> h['f'] = {t:1}
>
>> IDL> print, h['f'].t
>
>> 1
>
>
>
>
>
>> alx.
>
>
>
> Very good, so you, too, understand how to work _around_ this problem.
>
>
>
> Do you also understand why I referred to this as defeating the purpose of high-level data structures?
>
>
>
> --T
> Do you also understand why I referred to this as defeating the purpose of high-level data structures?
No, I do'nt. I do not understand what you mean by "high-level" data structures.
As previously said, IDL structures are defined like C structures: each field being defined "by value". If you want more flexibility, you can (and you must) use pointers (each field is then defined "by reference").
What else ?
alx.
|
|
|