Menu

package

Graham Barbour

Packages in Principia

A Principia [document] never stands alone. It is always a member of a package.



Preliminaries

While a [LaTeX] document may have any name and any extension, and, may reside in any directory, this is not the case for a [Principia] [document], which, in the first place, is abstract. There is no notion of a Principia file. Such notions pertain only to a particular [embedding].

  • Every Principia [document] has a name, which is a sequence of alpha-numeric characters beginning with an upper-case letter.

Particular embeddings impose file-name/url constraints based on the document name. For example, a [PriTeX file] embedding a Principia document called Foo must have file-name Foo.tex.

Packages

A Principia package is a mechanism for organising Principia documents into namespaces similar to the packages of Java. A package provides a unique namespace for the documents, and hence the types, it contains. It is legal for two documents to have the same name, provided they reside in different packages. This eases name clashing when documents are imported.

  • A package name is a non-empty sequence of "." separated lower-case initialled alpha-numeric strings.

For example, foo and foo.bAR7 are valid package names, but 'Foo.bAR7', 'foo.Bar' and 'foo.7bar' are illegal.

While the package name is a unit, for ease of discourse only, the separated lower-case initialled alpha-numeric strings are called a package-units. So a package name is a non-empty sequence of "." separated package-units.

Currently, a further restriction is demanded.

  • No package-unit may have the value src.

This restriction will be dropped in the future. See [No src Restriction] for more information.

Embedding Constraints

Just as embeddings impose constraints on the file/url name based on the Principia document name, similar locational constraints are imposed based on the package name.

  • For example, a [PriTeX file] embedding a document with name Foo in package aaa.bbb, which must be called Foo.tex, must reside in the bbb subdirectory of the aaa subdirectory of a directory called src. The source-directory src may reside anywhere.

Related

Wiki: Hello Principia World
Wiki: LaTeX
Wiki: No src Restriction
Wiki: PriTeX file
Wiki: Principia
Wiki: document

MongoDB Logo MongoDB