ITT VIS had several presentations about IDL 8.0 at this week’s IDL User Group Meeting. David Fanning says:

Just one word: Wow!

It appears that the promise of IDL 5 has finally been realized. :-)

David also posted a longer description of the new features, so I won’t go through the laundry list (but I do intend to run through it with some examples when 8.0 is actually released, like I did for 7.1).

But I will discuss a bit the one feature that I have used extensively: operator overloading. This was the main focus of my talk about GPULib with IDL 8.0. The gist is that GPULib variables will be objects and if you are running IDL 8.0+, you can do things like the following:

IDL> a = gpuFindgen(10)
IDL> b = gpuFindgen(10)
IDL> c = a + b


This was easy to implement, just inherit from IDL_Object and write a method with the special name _overloadPlus:

function gpuvariable::_overloadPlus, left, right
compile_opt strictarr


Most operators are supported like +, -, /, *, MOD, EQ, etc., but also including brackets (both on the left side and right side of an assignment) and other special methods used by PRINT, HELP, and SIZE. The dot operator is automatically connected to the getProperty and setProperty methods of the class.
Another nice point is that GPULib will not require separate versions for pre-8.0 and post-8.0 versions of IDL. Just write a simple dummy IDL_Object class. This will allow the code to be compiled in versions of IDL before 8.0 and won’t be found (because the real IDL_Object is part of IDL’s core and found before any user routines) in versions 8.0+. Of course, only the old procedure or function interfaces are available in versions before 8.0. I’m much more likely to use operator overloading because I can provide extra features for IDL 8.0 users and fall back to a more verbose interface for those who have not upgraded yet.
If you have the tech preview handed out at the meeting or are just interested in some more examples of this, check out these HDF5 classes which make use of operator overloading. The end of the mg_h5.pro file has a main-level program which shows how to use the classes:
IDL> .run mg_h5