unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* list conversion
@ 2003-05-06 19:46 Z. Huang
  2003-05-06 20:04 ` Barry Margolin
  2003-05-06 20:09 ` Jesper Harder
  0 siblings, 2 replies; 4+ messages in thread
From: Z. Huang @ 2003-05-06 19:46 UTC (permalink / raw)



Given a list ("first" "second" "third"). I'd to convert it to a 
a new list: 
   (("" . "first")
    ("" . "second")
    ("" . "third"))	

The following lisp code was intended for this purpose, but not working. It
looks that I missed some very basic stuff (I rarely code in lisp). Can
anyone point out what is wrong? Thanks in advance. 

(defun list-conversion (arg)
  (let ((l arg) (new-list ()))
    (while l
      (append new-list (list "" . (car l))))
      (setq l (cdr l))))

^ permalink raw reply	[flat|nested] 4+ messages in thread
* list conversion
@ 2003-05-06 19:33 Zhengao. Huang
  0 siblings, 0 replies; 4+ messages in thread
From: Zhengao. Huang @ 2003-05-06 19:33 UTC (permalink / raw)



Given a list ("first" "second" "third"), I'd like to  transfrom it into the
a new list: 
   (("" . "first")
    ("" . "second")
    ("" . "third"))	

The following lisp code was intended for this purpose, but not working. It
looks that I missed some very basic stuff (I rarely code in lisp). Can
anyone point out what is wrong? Thanks in advance. 

(defun list-conversion (arg)
  (let ((l arg) (new-list ()))
    (while l
      (append new-list (list "" . (car l))))
      (setq l (cdr l))))

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-05-06 20:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-06 19:46 list conversion Z. Huang
2003-05-06 20:04 ` Barry Margolin
2003-05-06 20:09 ` Jesper Harder
  -- strict thread matches above, loose matches on Subject: below --
2003-05-06 19:33 Zhengao. Huang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).