From: Ernest Smit
Subject: Sorting a structure-list
Date: 
Message-ID: <3AE442EA.18D19C96@oce.nl>
I have a list containing structures. How can I sort the list on one of
the structure-fields using the sort-function? My structure has a :name
field on which I wish to sort the list. 

Thanks,

Ernest

From: Raymond Wiker
Subject: Re: Sorting a structure-list
Date: 
Message-ID: <868zkrabuq.fsf@raw.grenland.fast.no>
Ernest Smit <····@oce.nl> writes:

> I have a list containing structures. How can I sort the list on one of
> the structure-fields using the sort-function? My structure has a :name
> field on which I wish to sort the list. 

(sort list-of-mystructs #'string-< :key #'mystruct-name)

--- or something like it.

-- 
Raymond Wiker
·············@fast.no
From: Janis Dzerins
Subject: Re: Sorting a structure-list
Date: 
Message-ID: <87hezfy7el.fsf@asaka.latnet.lv>
Ernest Smit <····@oce.nl> writes:

> I have a list containing structures. How can I sort the list on one of
> the structure-fields using the sort-function? My structure has a :name
> field on which I wish to sort the list. 

(defstruct foo
  name)

(sort foos #'string< :key #'foo-name) ; not tested

See http://www.xanalys.com/software_tools/reference/HyperSpec/Body/fun_sortcm_stable-sort.html for details.

-- 
Janis Dzerins

  If million people say a stupid thing it's still a stupid thing.