The hash table LAYOUT is a translation table from symbolic names to directory paths, which are to interpreted relative to the path stored in prefixDirectory. Some of the entries are strings: these provide paths to various types of files associated with the main Macaulay 2 system. The remaining entries are functions. These provide paths to various types of files associated with packages, and accept a string containing the name of the package as argument. Finally, for convenience, many Macaulay 2 files are regarded as being associated with a special package called Core, and the corresponding documentation files are part of the package Macaulay2.
i1 : LAYOUT o1 = HashTable{bin => bin/ } cache => lib/Macaulay2/Core/cache/ data => share/ datam2 => share/Macaulay2/ doc => share/doc/ docm2 => share/doc/Macaulay2/ docm2rel => share/doc/Macaulay2/Core/ docpackages => share/doc/Macaulay2/ emacs => share/emacs/site-lisp/ emacsdoc => share/doc/Macaulay2/Core/emacs/ images => share/doc/Macaulay2/Core/images/ info => info/ lib => lib/ libm2 => lib/Macaulay2/Core/ m2 => share/Macaulay2/Core/m2/ man => share/man/ man1 => share/man/man1/ man3 => share/man/man3/ packagecache => --Function[layout.m2:28:36-28:73]-- packagedoc => --Function[layout.m2:24:34-24:71]-- packageexamples => --Function[layout.m2:29:39-29:76]-- packagehtml => --Function[layout.m2:27:35-27:72]-- packageimages => --Function[layout.m2:25:37-25:74]-- packages => share/Macaulay2/ packagesrc => --Function[layout.m2:23:34-23:67]-- packagetests => --Function[layout.m2:26:36-26:73]-- share => share/Macaulay2/Core/ style => share/doc/Macaulay2/Core/style/ o1 : HashTable |
Let's apply the functions above to the name of a fictional package named "FOO" to see what paths are returned.
i2 : applyValues (LAYOUT, f -> if instance(f,Function) then f "FOO" else f) o2 = HashTable{bin => bin/ } cache => lib/Macaulay2/Core/cache/ data => share/ datam2 => share/Macaulay2/ doc => share/doc/ docm2 => share/doc/Macaulay2/ docm2rel => share/doc/Macaulay2/Core/ docpackages => share/doc/Macaulay2/ emacs => share/emacs/site-lisp/ emacsdoc => share/doc/Macaulay2/Core/emacs/ images => share/doc/Macaulay2/Core/images/ info => info/ lib => lib/ libm2 => lib/Macaulay2/Core/ m2 => share/Macaulay2/Core/m2/ man => share/man/ man1 => share/man/man1/ man3 => share/man/man3/ packagecache => share/doc/Macaulay2/FOO/cache/ packagedoc => share/doc/Macaulay2/FOO/ packageexamples => share/doc/Macaulay2/FOO/examples/ packagehtml => share/doc/Macaulay2/FOO/html/ packageimages => share/doc/Macaulay2/FOO/images/ packages => share/Macaulay2/ packagesrc => share/Macaulay2/FOO/ packagetests => share/doc/Macaulay2/FOO/tests/ share => share/Macaulay2/Core/ style => share/doc/Macaulay2/Core/style/ o2 : HashTable |
The object LAYOUT is a hash table.