feat: Template operations (#41)
Relational functions are added using templates, and existing generic functions are made more strict with them. Also a new built-in typeOf function is added, that automatically updates itself. Resolves #34. Co-authored-by: Glen Whitney <glen@studioinfinity.org> Reviewed-on: #41
This commit is contained in:
parent
2609310b8e
commit
fe54bc6004
29 changed files with 480 additions and 119 deletions
|
@ -3,6 +3,7 @@ import math from '../src/pocomath.mjs'
|
|||
import PocomathInstance from '../src/core/PocomathInstance.mjs'
|
||||
import * as numbers from '../src/number/all.mjs'
|
||||
import * as numberAdd from '../src/number/add.mjs'
|
||||
import {add as genericAdd} from '../src/generic/arithmetic.mjs'
|
||||
import * as complex from '../src/complex/all.mjs'
|
||||
import * as complexAdd from '../src/complex/add.mjs'
|
||||
import * as complexNegate from '../src/complex/negate.mjs'
|
||||
|
@ -66,6 +67,7 @@ describe('A custom instance', () => {
|
|||
const cherry = new PocomathInstance('cherry')
|
||||
cherry.install(numberAdd)
|
||||
await extendToComplex(cherry)
|
||||
cherry.install({add: genericAdd})
|
||||
/* Now we have an instance that supports addition for number and complex
|
||||
and little else:
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue