| 1 | [[PageOutline]] |
|---|
| 2 | = TOL Packages = |
|---|
| 3 | TOL packages are objects of type NameBlock containinig libraries, tools and |
|---|
| 4 | examples writen in TOL in order to help users to make an efficient and |
|---|
| 5 | standarized use of the language. |
|---|
| 6 | |
|---|
| 7 | == Using TOL Packages == |
|---|
| 8 | The only requirement to use them is open source cross-platform sofware |
|---|
| 9 | [http://www.gnu.org/software/wget/ wget] that is distributed with almost |
|---|
| 10 | all linux systems. A Windows binary setup is available |
|---|
| 11 | [http://downloads.sourceforge.net/gnuwin32/wget-1.11.4-1-setup.exe here]. |
|---|
| 12 | |
|---|
| 13 | In order to load a package like !GraphTools in your code you only need to |
|---|
| 14 | write |
|---|
| 15 | {{{ |
|---|
| 16 | #Require GraphTools; |
|---|
| 17 | }}} |
|---|
| 18 | |
|---|
| 19 | This command creates an object of type NameBlock with the same name in the |
|---|
| 20 | global scope, so that subsequent calls from the same session does |
|---|
| 21 | absolutely nothing. The command returns nothing in the current scope, ie is |
|---|
| 22 | transparent to the browser !TolBase and for the contents of the sets, |
|---|
| 23 | instances, etc. The first time you use a package in a computer it will be |
|---|
| 24 | automatically installed from this public repository. |
|---|
| 25 | |
|---|
| 26 | If you want to upgrade to a newer version of a package you can call global |
|---|
| 27 | function |
|---|
| 28 | {{{ |
|---|
| 29 | Real UpgradePackage(Text PackageName) |
|---|
| 30 | }}} |
|---|
| 31 | In order to upgrade all local packages you can write |
|---|
| 32 | {{{ |
|---|
| 33 | Real UpgradePackage("all") |
|---|
| 34 | }}} |
|---|
| 35 | |
|---|
| 36 | == Building TOL Packages == |
|---|
| 37 | |
|---|
| 38 | The package has a '''root directory''' whose name follows the CamelCase |
|---|
| 39 | convention, and it will have a '''main file''' with the same name and |
|---|
| 40 | extension {{{.tol}}} containing just one object of type NameBlock that is |
|---|
| 41 | the '''engine''' of the package. From the NameBlock it will be loaded any |
|---|
| 42 | file situated inside the root directory in an arbitrary hierarchy of |
|---|
| 43 | subdirectories. |
|---|
| 44 | |
|---|
| 45 | Usually the directory have also an special directory called '''test''' where |
|---|
| 46 | there standard TOL checking programs tha can be used also as examples of use. |
|---|
| 47 | |
|---|
| 48 | Some complex packages can require specific documentation that will be put in |
|---|
| 49 | '''doc''' directory. |
|---|
| 50 | |
|---|
| 51 | When a package requires to load another packages the engine NameBlock will |
|---|
| 52 | have the corresponding {{{#Require }}} orders before the first member. |
|---|
| 53 | This information will be stored by the NameBlock and will be attached to the |
|---|
| 54 | compressed OIS in order to be loaded before the caller package when a user |
|---|
| 55 | requires it. |
|---|
| 56 | |
|---|
| 57 | == Available TOL Packages == |
|---|