From: ·······@yahoo.com
Subject: need help with data structure problem
Date: 
Message-ID: <3bda79ac.6727471@news.dallas.sbcglobal.net>
Hi,
I need to create a short function, ( join_similar expr) where expr is
a data structure with the following format: 
( (x1 y1) (x2 y2) (x3 y3) ... (xn yn)), 

join_similar should return an expression like: 
( (x1 y1 y2) (x3 y3) ... ) when x1=x2 

for instance:
* (join_similar  �((3 4) (7 5) (3 6) (7 8) (3 9) (0 1))
would return:
((3 4 6 9) (7 5 8) (0 1))

I'm still very new to lisp and am having a great deal of difficulty
with this little problem so if someone can point me to the right
direction, I would appreciate it very much.   The only thing I can
think of is having a recursive function that would 
check the first of the first element and check the first of each of
the other members to see if they are equal.  
if they are, cons their second's together
then somehow I would need to move to the next element and do the same
thing, but I am not sure about how to implement that either....

so as you can see, i need alot of help here!  thank you in advance.

From: Kent M Pitman
Subject: Re: need help with data structure problem
Date: 
Message-ID: <sfwsnbufgrn.fsf@world.std.com>
·······@yahoo.com writes:

> I need to create a short function, ( join_similar expr) where expr is
> a data structure with the following format: 
> ( (x1 y1) (x2 y2) (x3 y3) ... (xn yn)), 
> 
> join_similar should return an expression like: 
> ( (x1 y1 y2) (x3 y3) ... ) when x1=x2 

If this is homework (and since someone else recently asked the same
question, I must assume it is), you should always say so explicitly
so that no one thinks you are trying to cheat and get someone else to
do it without realizing that's what they are doing.

When doing homework, it is also important that you show you are trying
so that people can comment on your tries, not just give you the
answer.  Show us what you've done so far, and people will be more
forthcoming about how to get to the next step.  It serves little point
for us to simply tell you the answer.
From: Barry Margolin
Subject: Re: need help with data structure problem
Date: 
Message-ID: <ssCF7.8$I16.3973@burlma1-snr2>
In article <···············@world.std.com>,
Kent M Pitman  <······@world.std.com> wrote:
>If this is homework (and since someone else recently asked the same
>question, I must assume it is)

It was the same poster asking the same question.  The Subject lines were
identical, but the formatting of the message text wasn't.

-- 
Barry Margolin, ······@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.