Adding New Primitives

Because of Java package and file conventions, keep these two rules in mind when adding new primitives:

Additionally, these are the NeXtMidas rules for primitives:

There are two way to add new primitives:

The first method is the easiest way to add a new primitive. For instance, to write a primitive that takes in one input file or pipe, and outputs one file or pipe, consider starting with the NOOP command. Assume an option tree called user is on the path and a primitive called newprim is desired:

  1. Copy NOOP from the prim area SYS option tree to the prim area of the user option tree
  2. Rename the noop.java file in the user option tree to newprim.java
  3. Change the package name in newprim.java from package nxm.sys.prim; to package nxm.user.prim;
  4. Change the class name (after public class ) from noop to newprim

To override a command (keep the same name but in a different option tree), use the CHECKOUT command.