| # Program Conversion |

For those of you who wish to convert some existing code to use the new library there are a few do's and don'ts.

Note that array indexing is now done as a value of class CARD (cardinal numbers). In fact note that almost everything which isn't explicitly mathematical uses CARDs. So much so that the first time an integer was really encountered in the library was in the stepto! iters - apart from the class INT itself.

WARNING | Beware those bits of code which run off the bottom of a loop, say, with a test for something being less than zero.

Text literals (chars and strings) are strongly deprecated in every piece of code. They stick at being the same coding used when compiling. This can only be got round by rigorously producing message files [see the format file for details] - one per class - well it is most unlikely that there would need to be more than one that this is built-in to the new library - a maximum of one that is.

See the class RESOURCES in the cultural section of the library for the 'read' operation. See, for example code, the partial class BOOL_STR or ENUM_STR to be found in the Representation/Converters section of the library.

Note that the word 'format' has two quite different meanings and both are used in the representation of values as text strings :-

- Value formatting is defined by the international culture standards which applies to numbers, dates, times, money, etc, etc.
- Text formatting applies to message composition - which now uses the Sather form (not the C form) only. It is strongly suggested that, when preparing message blanks you number the value arguments eg '<2:>' so that the position in the sentence may be changed when translating the messages into Swahili or Chinese or ... - without changing the program. This is particularly important when marketing software internationally, of course.

Apart from these everything you used in the existing library should work the same way - unless you rely on a void test - they have all been moved to pre-conditions.

Talking about pre-conditions, their use is spread liberally around the library - almost everything but predicates and some creation routines. Their use, however, makes an alarming start up time for the cultural stuff as string comparisons abound liberally in pre/post conditions. The start-up time with pre/post conditions, instead of being just over load time (a second or so), is fourteen seconds on a 330MHz x86 machine.

Once this is over, of course normal speed of running applies.

Comments or enquiries should be made to Keith Hopper . Page last modified: Monday, 16 October 2000. |