feat: Allow nonrecursive whole-function dependencies (#2)

And implement negate on numbers, and use dependencies to define subtract.

Co-authored-by: Glen Whitney <glen@studioinfinity.org>
Reviewed-on: #2
This commit is contained in:
Glen Whitney 2022-07-19 03:10:55 +00:00
parent f5e2e09aa2
commit b59a8c2ca9
6 changed files with 43 additions and 4 deletions

3
generic/subtract.mjs Normal file
View file

@ -0,0 +1,3 @@
export const subtract = {
'any,any': [['add', 'negate'], ref => (x,y) => ref.add(x, ref.negate(y))]
}