Page 1 of 1

Polynomial representation and manipulation

Posted: Sun Dec 30, 2012 5:34 pm
by cleverhorn
Hi,

I just started learning (common) lisp so I am new to it. I saw that there was an assignment up-coming soon but I decided to try it as early as possible to get all the generic ideas.

The main idea is to make a simple program that does this:
turns " (x+y)^2 " into " x^2 + 2xy + y^2 "
and few more. (I want to do those other things myself so I can learn)

How do I do this in clisp ? Because I am not sure how I should represent in a suitable way and how I should write the function.

So, if any could care, some snippet code will definitely be useful. I am not asking anyone to write down the whole function for me. A bit of idea with an explanation of the function and background would definitely help me kick start.

Yes, I am new to this forum.

Good day.

Re: Polynomial representation and manipulation

Posted: Sun Dec 30, 2012 8:19 pm
by sylwester
Hi and welcome to the forum.

Might be slightly off topic but SICP videoes, lecture 4B at about 57 minutes implements adding polynomials. It's an early Scheme so you'll have to port it to CL, but it might give you some ideas and the videoes are quite entertaining :-)

Syl