[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

list conversion

From: Zhengao. Huang
Subject: list conversion
Date: 06 May 2003 15:33:35 -0400

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))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]