Bootstrap addPrototype: #Module derivedFrom: {Cloneable}. Bootstrap Module addSlot: #variables. Bootstrap Module addSlot: #functions. Bootstrap Module addSlot: #imports valued: {}. Bootstrap Module addSlot: #exports valued: {}. mod@(Bootstrap Module traits) new [| newMod | newMod: mod clone. newMod variables: Dictionary newEmpty. newMod functions: Dictionary newEmpty. newMod ]. mod@(Bootstrap Module traits) defineVariable: name valued: val typed: type [ mod variables at: name put: (Bootstrap Variable newIn: mod named: name valued: val typed: type) ]. mod@(Bootstrap Module traits) defineFunction: name valued: val typed: type [ mod functions at: name put: (Bootstrap Function newIn: mod named: name valued: val typed: type) ]. mod@(Bootstrap Module traits) findFunction: name "Searches Module functions and then recursively through the imports, returning Nil if not found." [ mod functions at: name ifAbsent: [mod imports do: [| :import | (import findFunction: name) ifNotNilDo: [| :function | ^ function]]]. ]. mod@(Bootstrap Module traits) findVariable: name "Searches Module variables and then recursively through the imports, returning Nil if not found." [ mod variables at: name ifAbsent: [mod imports do: [| :import | (import findVariable: name) ifNotNilDo: [| :variable | ^ variable]]]. ]. mod@(Bootstrap Module traits) addImport: import [ mod imports: mod imports ; { import } ]. mod@(Bootstrap Module traits) addImports: imports [ mod imports: mod imports ; imports ]. mod@(Bootstrap Module traits) addExport: export [ mod exports: mod exports ; { export } ]. mod@(Bootstrap Module traits) addExports: exports [ mod exports: mod exports ; exports ].