Back


Adding a new package

If you have some major new functionality to add you may prefer to create a new package rather than extend one of the standard ones. It's only a little more dificult. The main thing to note is that each package is uniquely identified by its initial letter, so there can never be more than 26 packages in use at one time. Since we've already used A, B, G and M you'll have to pick package names starting with something else.

Each package needs to conform to an overall structure. Part of this is a set of subdirectories:

condition
handler
keyword
runtime
value

None of these need to have any files in them, but they do have to be present.

There are also some class files that may have to be present. Suppose your new package is called xtra; here are the required classes:

xtra/XLErrors.class
xtra/XLGetCondition.class
xtra/XLGetValue.class

You can model each of these on the ones in the basic package.

To use the new package, add it to the list in the main program (LS.class or whatever you've renamed it to). The compiler will pick it up automatically when it can't find a keyword, value or condition in any of the preceeding packages in the list.


Back