This website requires JavaScript.
Explore
Help
Sign In
glen
/
pocomath
Watch
2
Star
1
Fork
You've already forked pocomath
0
Code
Issues
3
Pull Requests
Projects
Releases
Wiki
Activity
9fb3aa2959
pocomath
/
src
/
generic
/
subtract.mjs
4 lines
88 B
JavaScript
Raw
Normal View
History
Unescape
Escape
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: https://code.studioinfinity.org/glen/pocomath/pulls/2
2022-07-19 03:10:55 +00:00
export
const
subtract
=
{
feat: Switch to function-based specification of dependencies Allows dependencies to be economically expressed and used. For example, see the new definition of subtract. Credit for the basic idea goes to James Drew, see https://stackoverflow.com/a/41525264 Resolves #21.
2022-07-23 16:55:02 +00:00
'any,any'
:
(
{
add
,
negate
}
)
=>
(
x
,
y
)
=>
add
(
x
,
negate
(
y
)
)
}