From: [InFeRn0]
Subject: Beginner LISP Question
Date: 
Message-ID: <kpRA5.94$BE6.45077@sapphire.mtt.net>
Hello All,

Our 1st assignment in our functional and logic programming course deals with
LISP.

If we give LISP the command:
>(SIMPLIFYPOLY '(POLY (X Y) (2 1 1)(3 2 1)(-2 1 1))
it should return
(POLY (X Y) (3 2 1))

It's a function to simplify polynomials. (ie 2xy + 3x^2y -2xy simplifies to
3x^2y).

The only argument given to SIMPLIFYPOLY is a list where the 1st element is
POLY and the 2nd is (X Y) and then there's N number of terms. At 1st I
thought each term enclosed in brackets was a list but this doesn't seem to
be the case because if I try to take the first of the rest of '(POLY (X Y))
it just gives me (X Y) as opposed to X which is what I'd be looking for.

My question is how do I access an individual element of any given term in
the polynomial? (Please answer this question and provide any relevant
information which might be helpful to me but please do NOT tell me any more
than is absolutely necessary as I want to figure it out myself =)

Thanks.

Shea

From: [InFeRn0]
Subject: Re: Beginner LISP Question
Date: 
Message-ID: <_sRA5.95$BE6.44854@sapphire.mtt.net>
Sorry! Just figured it out.

I had to take the first OF THE first of the last =)

"[InFeRn0]" <·······@whodat.com> wrote in message
·······················@sapphire.mtt.net...
> Hello All,
>
> Our 1st assignment in our functional and logic programming course deals
with
> LISP.
>
> If we give LISP the command:
> >(SIMPLIFYPOLY '(POLY (X Y) (2 1 1)(3 2 1)(-2 1 1))
> it should return
> (POLY (X Y) (3 2 1))
>
> It's a function to simplify polynomials. (ie 2xy + 3x^2y -2xy simplifies
to
> 3x^2y).
>
> The only argument given to SIMPLIFYPOLY is a list where the 1st element is
> POLY and the 2nd is (X Y) and then there's N number of terms. At 1st I
> thought each term enclosed in brackets was a list but this doesn't seem to
> be the case because if I try to take the first of the rest of '(POLY (X
Y))
> it just gives me (X Y) as opposed to X which is what I'd be looking for.
>
> My question is how do I access an individual element of any given term in
> the polynomial? (Please answer this question and provide any relevant
> information which might be helpful to me but please do NOT tell me any
more
> than is absolutely necessary as I want to figure it out myself =)
>
> Thanks.
>
> Shea
>
>
From: Frank A. Adrian
Subject: Re: Beginner LISP Question
Date: 
Message-ID: <GpTA5.1953$Yc.442200@news.uswest.net>
> "[InFeRn0]" <·······@whodat.com> wrote in message
> ·······················@sapphire.mtt.net...
> > My question is how do I access an individual element of any given term
in
> > the polynomial? (Please answer this question and provide any relevant
> > information which might be helpful to me but please do NOT tell me any
> more
> > than is absolutely necessary as I want to figure it out myself =)

"[InFeRn0]" <·······@whodat.com> wrote in message
·······················@sapphire.mtt.net...
> Sorry! Just figured it out.
>
> I had to take the first OF THE first of the last =)

You have taken the first steps toward understanding the lambda nature,
grasshopper.
faa
From: William Deakin
Subject: Re: Beginner LISP Question
Date: 
Message-ID: <39D45941.D212BA60@pindar.com>
Frank A. Adrian wrote:
> You have taken the first steps toward understanding the lambda nature,
> grasshopper.
I alway thought that was `glass-hoppler'.

Thanks for clearing this up,

;)will
From: Klaas
Subject: Re: Beginner LISP Question
Date: 
Message-ID: <wMOH5.45872$Z2.652423@nnrp1.uunet.ca>
Ask here also if you have a question about assignment 3 :)

-Mike

[InFeRn0] <·······@whodat.com> wrote in message
·······················@sapphire.mtt.net...
> Sorry! Just figured it out.
>
> I had to take the first OF THE first of the last =)
>
> "[InFeRn0]" <·······@whodat.com> wrote in message
> ·······················@sapphire.mtt.net...
> > Hello All,
> >
> > Our 1st assignment in our functional and logic programming course deals
> with
> > LISP.
> >
> > If we give LISP the command:
> > >(SIMPLIFYPOLY '(POLY (X Y) (2 1 1)(3 2 1)(-2 1 1))
> > it should return
> > (POLY (X Y) (3 2 1))
> >
> > It's a function to simplify polynomials. (ie 2xy + 3x^2y -2xy simplifies
> to
> > 3x^2y).
> >
> > The only argument given to SIMPLIFYPOLY is a list where the 1st element
is
> > POLY and the 2nd is (X Y) and then there's N number of terms. At 1st I
> > thought each term enclosed in brackets was a list but this doesn't seem
to
> > be the case because if I try to take the first of the rest of '(POLY (X
> Y))
> > it just gives me (X Y) as opposed to X which is what I'd be looking for.
> >
> > My question is how do I access an individual element of any given term
in
> > the polynomial? (Please answer this question and provide any relevant
> > information which might be helpful to me but please do NOT tell me any
> more
> > than is absolutely necessary as I want to figure it out myself =)
> >
> > Thanks.
> >
> > Shea
> >
> >
>
>