Skip to content

Commit

Permalink
Cleanup bridge script to just add extra functions
Browse files Browse the repository at this point in the history
  • Loading branch information
wqferr committed Feb 29, 2024
1 parent 44314d3 commit a825025
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 34 deletions.
32 changes: 0 additions & 32 deletions lua/im-sd-bridge.lua → lua/extra-funcs.lua
Original file line number Diff line number Diff line change
@@ -1,37 +1,5 @@
local sd = _G.sd
local im = _G.im
-- sd.setNumericChecks {
-- isNumeric = function(x)
-- return type(x) == "number" or im.isComplex(x)
-- end,
-- isZero = function(x)
-- return x == 0 or x == im.zero
-- end,
-- isOne = function(x)
-- return x == 1 or x == im.one
-- end
-- }

local replacedFuncs = {
"exp",
"ln",
"sqrt",
"sin",
"cos",
"tan",
"sinh",
"cosh",
"tanh",
}
for k, v in pairs(replacedFuncs) do
if type(k) == "number" then
sd[v].func = im[v]
else
sd[k].func = im[v]
end
end

-- TODO: fix hyperbolic trig functions

local one = sd.const(im.one)
local constOne = sd.func(function() return one end)
Expand Down
2 changes: 1 addition & 1 deletion lua/symdiff
Submodule symdiff updated 1 files
+3 −3 symdiff.lua
2 changes: 1 addition & 1 deletion lua/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ local sd = _G.sd
local Bounds = require "bounds"
local App = require "app"
require "constants"
require "im-sd-bridge"
require "extra-funcs"

-- TODO: add actual line smoothing to input
local document = js.global.document
Expand Down

0 comments on commit a825025

Please sign in to comment.