Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Scheme > Re: Sort a list...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 17 Topic 4626 of 4665
Post > Topic >>

Re: Sort a list of dotted pairs

by "Kjetil S. Matheussen" <k.s.matheussen@[EMAIL PROTECTED] > Jul 24, 2008 at 12:59 PM

On Wed, 23 Jul 2008, Pascal J. Bourguignon wrote:

> BastiL2001@[EMAIL PROTECTED]
 writes:
> 
> > Dear group,
> >
> > I have a list of dotted pairs that may look something like this:
> > ((4 . something) (2 . maybe ) (3 . this ) (7 . last ) (5 . some))
> >
> > I want it to be sorted after the car of each dotted pair starting with
> > the lowest number...
> >
> > ((2 . maybe) (3 . this) (4 . something) (5 . some) (7 . last))
> >
> > Only thing I have done so far is the sort function which does not seem
> > to help in that case... How could this be done? Thanks.
> 
> It depends on how you made this sort function.
> If you made it like Common Lisp sort, then you can just write:
> 
>      (sort a-list < 'key car)
> 
> But if you made it like the sort we usually find in scheme libraries,
> then  you will have to write:
> 

Not really:

(sort a-list function-which-compares-cars)
 




 17 Posts in Topic:
Sort a list of dotted pairs
BastiL2001@[EMAIL PROTECT  2008-07-23 08:20:08 
Re: Sort a list of dotted pairs
Grant Rettke <grettke@  2008-07-23 10:05:04 
Re: Sort a list of dotted pairs
pjb@[EMAIL PROTECTED] (P  2008-07-23 19:35:13 
Re: Sort a list of dotted pairs
Abdulaziz Ghuloum <agh  2008-07-23 11:51:56 
Re: Sort a list of dotted pairs
"Kjetil S. Matheusse  2008-07-24 10:25:16 
Re: Sort a list of dotted pairs
"Kjetil S. Matheusse  2008-07-24 12:59:28 
Re: Sort a list of dotted pairs
pjb@[EMAIL PROTECTED] (P  2008-07-24 14:36:45 
Re: Sort a list of dotted pairs
leppie <xacc.ide@[EMAI  2008-07-24 05:52:43 
Re: Sort a list of dotted pairs
leppie <xacc.ide@[EMAI  2008-07-24 05:55:43 
Re: Sort a list of dotted pairs
Grant Rettke <grettke@  2008-07-24 06:29:16 
Re: Sort a list of dotted pairs
"Kjetil S. Matheusse  2008-07-24 16:24:53 
Re: Sort a list of dotted pairs
pjb@[EMAIL PROTECTED] (P  2008-07-24 16:27:20 
Re: Sort a list of dotted pairs
"Kjetil S. Matheusse  2008-07-24 16:25:24 
Re: Sort a list of dotted pairs
leppie <xacc.ide@[EMAI  2008-07-24 07:46:52 
Re: Sort a list of dotted pairs
leppie <xacc.ide@[EMAI  2008-07-24 07:51:28 
Re: Sort a list of dotted pairs
Grant Rettke <grettke@  2008-07-24 08:43:25 
Re: Sort a list of dotted pairs
"Kjetil S. Matheusse  2008-07-24 18:09:38 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Aug 20 12:57:53 CDT 2008.