refactor: Simpler merging mechanism
Merging of Pocomath modules is eased by allowing one PocomathInstance to be merged into another. That allows types, for example, to be exported as a PocomathInstance (so there is no need for a special identifier convention for types; they can be directly added with an installType method). Also, larger modules can just be exported as an instance, since there is more flexibility and more checking in merging PocomathInstances than raw modules.
This commit is contained in:
parent
58fa661a2d
commit
d9d7af961f
12 changed files with 146 additions and 89 deletions
|
@ -1,2 +1,5 @@
|
|||
export const Type_undefined = {test: u => u === undefined}
|
||||
import PocomathInstance from '../../core/PocomathInstance.mjs'
|
||||
const Undefined = new PocomathInstance('Undefined')
|
||||
Undefined.installType('undefined', {test: u => u === undefined})
|
||||
export {Undefined}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue