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

Home » Public Forums » archive » Re: Case Insensitive Hash but still preserve cases of original keys
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Case Insensitive Hash but still preserve cases of original keys [message #84598] Tue, 15 July 2014 19:44 Go to next message
SonicKenking is currently offline  SonicKenking
Messages: 51
Registered: October 2010
Member
On Tuesday, July 15, 2014 10:32:30 PM UTC+10, fawltyl...@gmail.com wrote:
> On Tuesday, July 15, 2014 1:11:06 PM UTC+2, SonicKenking wrote:
>
>
>
>> What I am confused is how PRINT gets the value for the key "X"? It seems to me that it should call something like self["X"], i.e. SpecialHash::_overloadBracketsRightSide. However it is not the case and this can be verified by setting a breakpoint as well.
>
>
>
> There is an undocumented function hash::get:
>
>
>
> IDL> print, (hash(0,0))[0]
>
> 0
>
> IDL> .comp hash_get
>
> % Compiled module: HASH::GET.
>
> IDL> print, (hash(0,0))[0]
>
> HASH::GET called: 0
>
> 0
>
> IDL>
>
>
>
> hash_get.pro is:
>
>
>
> function hash::get, key, _extra=ext
>
> print, 'HASH::GET called: ', key
>
> return, 0
>
> end
>
>
>
> PRINT probably calls self.get(...), so you can try to add a SpecialHash::Get function.
>
>
>
> regards,
>
> Lajos

Thanks Lajos. Override the Get() function solves the problem!

Inspired by your answer, I dug a bit more into the HASH internals. So HASH sometimes works off the internal data structure (e.g. TABLE_DATA) without consulting the public APIs. This creates problem for subclasses that alter the behaviors of public APIs.

One more example is that the FOREACH loop of SpecialHash display the key 'x' in lowercase, while it really should be in uppercase.

IDL> foreach v,h, k do print, k, v
x 1337

My guess is that Hash's foreach implementation gets the keys directly from the internal self.TABLE_DATA structure. The keys() function hence never gets called and doesn't have the chance to provide the correct case of key 'X'
Re: Case Insensitive Hash but still preserve cases of original keys [message #89029 is a reply to message #84598] Wed, 16 July 2014 14:28 Go to previous messageGo to next message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
Hi all,

Just FYI, in IDL 8.4 the HASH and ORDEREDHASH will have a new FOLD_CASE keyword. This will make the Hash and OrderedHash be case insensitive but still preserve the case of the keys, which I believe is exactly what you want.

Cheers,
Chris
Re: Case Insensitive Hash but still preserve cases of original keys [message #89032 is a reply to message #89029] Wed, 16 July 2014 17:34 Go to previous messageGo to next message
SonicKenking is currently offline  SonicKenking
Messages: 51
Registered: October 2010
Member
On Thursday, July 17, 2014 7:28:22 AM UTC+10, Chris Torrence wrote:
> Hi all,
>
>
>
> Just FYI, in IDL 8.4 the HASH and ORDEREDHASH will have a new FOLD_CASE keyword. This will make the Hash and OrderedHash be case insensitive but still preserve the case of the keys, which I believe is exactly what you want.
>
>
>
> Cheers,
>
> Chris

Hi Chris,

That's a great news. Can't wait to see other new features in 8.4! Is there an estimated release date?

Thanks a lot for the response.

Cheers,
Yang
Re: Case Insensitive Hash but still preserve cases of original keys [message #89039 is a reply to message #89032] Thu, 17 July 2014 09:26 Go to previous messageGo to next message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
On Wednesday, July 16, 2014 6:34:18 PM UTC-6, SonicKenking wrote:
> On Thursday, July 17, 2014 7:28:22 AM UTC+10, Chris Torrence wrote:
>
>> Hi all,
>
>>
>
>>
>
>>
>
>> Just FYI, in IDL 8.4 the HASH and ORDEREDHASH will have a new FOLD_CASE keyword. This will make the Hash and OrderedHash be case insensitive but still preserve the case of the keys, which I believe is exactly what you want.
>
>>
>
>>
>
>>
>
>> Cheers,
>
>>
>
>> Chris
>
>
>
> Hi Chris,
>
>
>
> That's a great news. Can't wait to see other new features in 8.4! Is there an estimated release date?
>
>
>
> Thanks a lot for the response.
>
>
>
> Cheers,
>
> Yang

Should be right around November. Lots of cool features, including code coverage, big integers, lambda functions, and static methods for variables...
-Chris
Re: Case Insensitive Hash but still preserve cases of original keys [message #89040 is a reply to message #89039] Thu, 17 July 2014 09:53 Go to previous messageGo to next message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
lambda functions! 8o0

Code blocks in IDL?!?!

Goodness.

On 07/17/14 12:26, Chris Torrence wrote:
> On Wednesday, July 16, 2014 6:34:18 PM UTC-6, SonicKenking wrote:
>>
>> That's a great news. Can't wait to see other new features in 8.4!
>> Is there an estimated release date?
>>
>
> Should be right around November. Lots of cool features, including
> code coverage, big integers, lambda functions, and static methods for
> variables... -Chris
>
Re: Case Insensitive Hash but still preserve cases of original keys [message #89044 is a reply to message #89039] Thu, 17 July 2014 14:36 Go to previous messageGo to next message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 7/17/14, 10:26 AM, Chris Torrence wrote:
> Should be right around November. Lots of cool features, including
> code coverage, big integers, lambda functions, and static methods for
> variables... -Chris
>

Code coverage? Like which lines of a routine have been executed? That
would be an awesome feature for mgunit; I would be able to report back a
lot of useful information about the coverage of a test suite.

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation
Re: Case Insensitive Hash but still preserve cases of original keys [message #89045 is a reply to message #89044] Thu, 17 July 2014 16:08 Go to previous messageGo to next message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
On Thursday, July 17, 2014 3:36:16 PM UTC-6, Mike Galloy wrote:
>
>
> Code coverage? Like which lines of a routine have been executed? That
>
> would be an awesome feature for mgunit; I would be able to report back a
>
> lot of useful information about the coverage of a test suite.
>
>

Yep, that's exactly it. There's a standalone function you can call, and it's also integrated into the Workbench and the Profiler.
-Chris
Re: Case Insensitive Hash but still preserve cases of original keys [message #89049 is a reply to message #89039] Fri, 18 July 2014 01:57 Go to previous messageGo to next message
Fabzi is currently offline  Fabzi
Messages: 305
Registered: July 2010
Senior Member
On 17.07.2014 18:26, Chris Torrence wrote:
> Lots of cool features, including code coverage, big integers,
> lambda functions, and static methods for variables

Sounds like py**on but in much better because it's IDL ;-)

Code coverage surely is really great.

Are you willing to share a bit more? What will these static methods be
able to do?
Re: Case Insensitive Hash but still preserve cases of original keys [message #89050 is a reply to message #89039] Fri, 18 July 2014 07:48 Go to previous messageGo to next message
markb77 is currently offline  markb77
Messages: 217
Registered: July 2006
Senior Member
On Thursday, July 17, 2014 6:26:30 PM UTC+2, Chris Torrence wrote:

>
> Should be right around November. Lots of cool features, including code coverage, big integers, lambda functions, and static methods for variables...
>
> -Chris

cool!

+1 vote for parallel (multi-threaded) computing support which is compatible with the virtual machine
Re: Case Insensitive Hash but still preserve cases of original keys [message #89062 is a reply to message #89044] Mon, 21 July 2014 09:38 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
On 07/17/14 17:36, Michael Galloy wrote:
> On 7/17/14, 10:26 AM, Chris Torrence wrote:
>> Should be right around November. Lots of cool features, including
>> code coverage, big integers, lambda functions, and static methods for
>> variables... -Chris
>>
> Code coverage? Like which lines of a routine have been executed? That
> would be an awesome feature for mgunit; I would be able to report back a
> lot of useful information about the coverage of a test suite.

As an avid user of mgunit, that would be marvyplate. I am a lazy
unit-test writer... (downcast eyes) ...but isn't everyone? :o/

cheers,

paulv
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: shmmap error
Next Topic: Need to convert a grayscale image to a binary (1s and 0s) image...

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

Current Time: Wed Oct 08 11:42:04 PDT 2025

Total time taken to generate the page: 0.00637 seconds