News for hackers. Stuff that matters.
Re:Is Lisp a Blub Language? by shaunxcode on Monday April 26, 2010 @09:35AM (#1294817)
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).
Re:Is Lisp a Blub Language? by yummyfajitas on Monday April 26, 2010 @09:49AM (#1294837)
Same 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.)