release-capricon-0.8: Towards a CaPriCon module system
lih
released this
02 Apr 03:52
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