This functor serves as a template which shows how you can define a Strasheela extension. An extention is defined as an Oz functor. The explanation is this template should be sufficient for defining your first functor, for more details see http://www.ps.uni-sb.de/~niehren/Web/Vorlesungen/Oz-NL-SS01/vorlesung/node106.html#chapter.modprog and http://www.mozart-oz.org/documentation/apptut/index.html, Part I. The extension is compiled and installed with ozmake (http://www.mozart-oz.org/documentation/mozart-ozmake/index.html). You compile/install this functor at the commandline by moving into its directory and then entering simply
ozmake --install
or, for re-compilation
ozmake --upgrade
Moreover, if you store your functor in strasheela/contributions/yourname then it will be installed automatically (together with the rest of Strasheela) whenever you call the UNIX script strasheela/scripts/upgrade-all.sh (see also the related scripts there).
Functor
MyExtension ("MyExtension.oz")
Import
- FD
- Aux at "source/MyFunctor.ozf"
- ClassDef at "source/ClassDefinitionDemo.ozf"
Export
- add:<P/3:Add>
- Aux
- ClassDef
Define
proc{Add X Y Z}
Declares X, Y, and Z to FD integers and defines X + Y = Z.
End