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

Home » Public Forums » archive » HASH with case insensitive keys versus a new DICT class
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 with case insensitive keys versus a new DICT class [message #82486 is a reply to message #82428] Wed, 12 December 2012 20:37 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Wednesday, December 12, 2012 10:10:51 PM UTC-5, Chris Torrence wrote:
> On Wednesday, December 12, 2012 12:09:34 PM UTC-7, Craig Markwardt wrote:
>
>> On Wednesday, December 12, 2012 1:05:08 AM UTC-5, Chris Torrence wrote:
>
>>
>
>>> Okay, I'll bite.
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> I have a specific use case for this, where using a "dynamic" structure would be very helpful. Users have also been asking for dynamic, extendable structures for years.
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> One more data point: It would take less than a day to make this update. Adding a new widget system would take more than a day.
>
>>
>
>>
>
>>
>
>> I would go at it from the other end and make the structure access operator "." overloadable from within the IDL language. Once that key language feature is added, then your particular use case of HASH as the backing store can be wired up with a few lines of IDL code, and you can choose whatever idiosyncracies you wish.
>
>>
>
>>
>
>>
>
>> Craig
>
>
>
> Hi Craig,
>
>
>
> Actually, it is already overloadable. As long as your class inherits from IDL_Object, then using a "." will call GetProperty (if it is on the right-hand-side of the equals), or SetProperty (if it is on the left-hand-side).
>
>
>
> And you're right, it was indeed just a couple of lines of code. The trickiness comes in because the IDL parser has already made the "field" name uppercase by the time it reaches the internal C structure code. I really don't want to mess with the IDL parser.

OK, then if I were you I would implement an *alternate* case-insensitive hash algorithm when you initialize a new hash, such that h['MYSTRING'] returns the same as h['mystring'], as h['MyString']. Turn that flag on for your special class, and you're done. My point being, separate the "IDL variable"ness from the case-insensitiveness.

Craig
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: colors and plot direct graphics function
Next Topic: Re: colors and plot direct graphics function

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

Current Time: Sun Oct 12 09:27:05 PDT 2025

Total time taken to generate the page: 0.80050 seconds