Re: dividing lists



rich wrote:
hi,
can anybody help m ewith dividing the given list into 3 parts as :
the list i have is
(1 3 4 5 0 6 A 2 4 7 8)
I have to divide this in 3 list as (1 3 4 5 0 6) (A) (2 4 78)
i.e lists to the left and right of symbol A
thanks.

(defun list-splitter (split-obj in-list)
(let ((position-split (position split-obj in-list)))
(list
(subseq in-list 0 position-split)
(list (nth position-split in-list))
(subseq in-list (1+ position-split)))))

(list-splitter 'a '(1 3 4 5 0 6 A 2 4 7 8))
(list-splitter 8 '(1 3 4 5 0 6 A 2 4 7 8))
(list-splitter 1 '(1 3 4 5 0 6 A 2 4 7 8))

Carl Taylor
.



Relevant Pages

  • Re: Why Israel Supported Dubais Attempt To Take Contol of US Ports
    ... Here's the standard shpiel I send out to the lists in which I ... Not all platforms handle HTML or rich ... and one in encoded HTML or rich text). ... If you're quoting a previous posting, ...
    (soc.culture.jewish.moderated)
  • Re: Rich text box question
    ... The intention was not to use a Rich Text Box for searching purposes but only ... I am using this vs a Listbox since the listbox has certain ... > that seriously lists 1000's of rows and then expects someone search or ...
    (microsoft.public.vb.general.discussion)
  • Re: Ubuntu/Kubuntu on Mac G5.
    ... (I use Mail.app to bottom post regularly) ... > mailing news articles from web sites to other lists. ... As for the matter at hand, check out your "Composing" preferences ... You can set the default format of ALL your e-mails to either Rich Text ...
    (Ubuntu)
  • Re: full text indexing and standard page...
    ... WSS doc lib or a WSS list. ... you are making him open a web page with one rich content web part on it. ... >> The contents of doc libs and lists are indexed but a rich content web ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: Rich text box question
    ... >> I have a rich text box which I will dump 1000's of rows of string info ... I am using this vs a Listbox since the listbox has certain ... > that seriously lists 1000's of rows and then expects someone search or ...
    (microsoft.public.vb.general.discussion)