Goetic Vitromancy relies upon a concept known as the Grimoire, which at its simplest level can be thought of in analagous terms to a module. Strictly speaking, each individual source file in Goetic Vitromancy is its own Grimoire. However, as is the case with other languages, it may be useful to include code from other Grimoires; a multi-Grimoire project will most likely have one main Grimoire in which the primary runtime is defined, or a small convenience script Grimoire may want to look for a standard library module to achieve a well-defined task quickly.
For this reason, there is a standard statement to be given before other code declarations in each script called the Grimoire block, as in the following example:
This Grimoire contains
The Messenger of the classic, Ars Terminal
And its own findings.
At its simplest level, this can be interpreted in the following way:
This Grimoire containsis a byphrase instructing the interpreter or compiler that all those lines which follow should be handled as imports or includes.The Messenger of the classic, Ars Terminais a complex import byphrase, which can be further broken down as:The, meaning one or more object names will follow;Messenger, the specific object desired to be included or imported;of the, a byphrase meaning the list of specific imports is now concluded;classic, an Origination byphrase, and finally;Ars Terminal, an identifier for the Grimoire to be included.
And its own findings., which is the byphrase instructing the interpreter or compiler that the list of inclusion messages is now complete.
From this breakdown, we can see that it is possible to include single objects from specific libraries, as is common in python. This is mainly done to help either the interpreter or the compiler keep the overall size of execution low.
Specific vs General Inclusion
The example code above provides an example of a specific inclusion. Specifically, it shows importing only the object Messenger from the Standard Library Grimoire, Ars Terminal. However, it is also possible to provide an entire library for convenience. This is achieved by providing a keyword, entirety, in place of an object name or list of object names. For example, if you wanted everything in the Standard Library Grimoire Ars Numeria, you would say The entirety of the class, Ars Numeria.
Origination Byphrases
Libraries imported into Grimoires can have special origins. This is done to help the compiler/interpreter find the source files necessary to affect the inclusion. Much as is the case with other languages, there is a broad range of library files that may need to be included in a file. The following is a (potentially incomplete) list of byphrases used for this purpose.
classicis a byphrase indicating the library which follows is a Standard Library grimoire and can be found in the global standard library path.<name>'sis a special byphrase that would indicate the module is a nonstandard module available in the package manger (if ever implemented), wherenameis the username of the originating Magician.forbiddenis a byphrase indicating that the development version of a Standard Library grimoire should be used instead of the stable version.moulderingis a byphrase indicating that the grimoire referred to exists in the Local Libraryapocryphalis a byphrase indicating that the grimoire referred to exists in the same directory as the script which is calling it.
Apocrypha introduce a special handling where they have a unique naming convention, which is to say 's . For example, if you wanted to supply a child library Classes, you might invoke it with the entirety of the apocryphal Classes. However, say you had classes inside a child directory, Helper; you would then invoke it with the entirety of the apocryphal Helper's Classes.
Standard vs Local Libraries
During installation of the interpreter or the compiler, both will have been supplied with (overridable) locations for a Standard Library and a Local Library. These provide locations to store both the Goetic Vitromancy Standard Library and any general-purpose scripts written by the Magician. In addition, the standard library contains two sub directories, classic and forbidden, which contain the release and development versions of each library, respectively.
Script Versus Directory Imports
Goetic Vitromancy supports modular grimoires with tagless reference in a manner similar to python.
Grant the following exists:
- some Project Dir/
- main.gvs
- Messenger.gvs
- Personality/
- standard_strings.gvs
- Responder.gvs
- Games.gvs
- Preface.gvs
Main could import both its messenger module and the entire Personality library like this:
This Grimoire contains:
The entirety of the apocryphal Messenger
The entirety of the apocryphal Personality
And its own findings.
In this case, the following things will happen:
- Messenger.gvs will be imported in its entirety.
- The compiler/interpreter will find no Personality.gvs and will instead check if it is a directory. Finding that, it will then look for (in order of preference),
Preface.gvsormain.gvsin that directory.
Preface.gvs, much like a __main__.py or some C header files, will itself contain a this grimoire contains byphrase that imports all of the other members of Personality. By convention, a Preface.gvs file should do no actual runtime coding apart from this, and exists as a convenient preface so that the entire Personality library can be loaded at once.