This function is part of the OpenMaple interface to Microsoft Visual Basic.

•

The MapleUnique function processes the Maple expression, s, and returns the unique normalized copy of that expression. For example, if you create the number num = one-billion, and then compute the number val = 2*500-million, an address comparison of num and val does not indicate equality. For example, after calling num = MapleUnique(kv,num);, both num and val point to the same memory.

•

Because Maple maintains a table of unique elements, only one copy of most objects exists in memory. The expression x2&plus;x contains two references to x, but both point to the same object. Similarly, 1&comma;2&comma;1&comma;2 contains two sublists, 1&comma;2. The surrounding list maintains two pointers to the same sublist. It is usually not safe to directly modify any object that has been processed by Maple. For example, if the sublist were changed from 1&comma;2 to 3&comma;2, the parent list also changes. In fact, all references to the list 1&comma;2 in Maple would then point to 3&comma;2. This would cause many problems. For example, table lookups of the 1&comma;2 element would be changed to look up the 3&comma;2 element. It is safe to directly modify only data blocks of mutable objects like rtables and tables. Never change strings returned by MapleToString, or expression sequences like the args object given to the external entry point.