fjames86 / fpoly

Manipulate dense multivariate polynomials
0 stars 0 forks source link

parser #34

Open fjames86 opened 11 years ago

fjames86 commented 11 years ago

could rewrite the parser to be more general/abstract.

instead of parsing the input string directly to a polynomial object, parse it to a parse-tree. this can then be converted to the structure itself. e.g.

(parse "x^2 + 2y") -> (:poly (x y) (1 (2 0)) (2 (0 1))) (parse "xy^(1 - 2*6)") -> (:poly (x y) (1 (1 -11))) (parse "cos(x + y)") -> (:apply cos (:poly (x y) (1 (1 0)) (1 (0 1))))

this then allows representing arbitrary expressions, e.g. function application etc.