Skip to content
Towards a CaPriCon module system

The CaPriCon interpreter can now make use of a caching mechanism to
store and retrieve arbitrary CaPriCon objects from a local
storage.

Using this feature, it becomes straightforward to implement a basic
module system, by storing the dictionaries that result from running a
source file. The following snippet illustrates such a module system :

> 'open { dup { dup source swap module } swap cache } def
> 'import-module { dup { import } { pop } "exports" lookup } def
> "foo" open import-module