Closed tkosan closed 7 years ago
yeah you're totally right, it's super hacky
it's because mathjs doesn't have an equation node (which I was sad to find out while building this)
once we switch to math-parser
we can clean up equation code to use the same kind of node as everywhere else
sound good?
Yes, cleaning up the equation code after the switch to math-parser
has been made sounds good. I will go ahead and submit a pull request for the demo I wrote and include a comment that indicates the mathsteps API will be changing in the near future.
I am working on cleaning up the code in the demo discussed in #124, and I realized that not having a uniform data structure to return steps in requires separate code to handle the different cases. For example, the steps returned from
solveEquation
uselib/equation/Equation.js
objects to hold expressions, but the steps return fromsimplifyExpression
usemath.expression.node.OperatorNode
objects to hold expressions. After studyinglib/equation/Equation.js
I am not sure what abilities it provides beyond those provided byOperatorNode
. Is there a reason for not treating equations more abstractly as expressions?