3 ms·
how would one define SolvePoly or even Take for that matter in terms of Mathematica if it were not "built in"? I am not saying it is impossible (I really do not
by shaunxcode 16y ago
how would one define SolvePoly or even Take for that matter in terms of Mathematica if it were not "built in"? I am not saying it is impossible (I really do not know and thus I am curious).
- yummyfajitas 16y agoSame way you would do it in lisp - you'd build a function to do pattern matching and use conditionals to test which pattern is matched. (defun solve-poly (p) (if (match '(+ (* ?a x) ?b) poly)) (-b/a where b, a come from (extract-values-from-pattern-match poly)) (some code for second order) )) (Some code borrowed from lispm's comment. Not sure which library the match function comes from.)