From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: zghuang@bloomberg.net (Z. Huang) Newsgroups: gmane.emacs.help Subject: list conversion Date: 06 May 2003 15:46:49 -0400 Organization: www.bloomberg.com Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1052253628 23587 80.91.224.249 (6 May 2003 20:40:28 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 6 May 2003 20:40:28 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Tue May 06 22:40:14 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19D9EE-00067A-00 for ; Tue, 06 May 2003 22:39:58 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19D8SV-0005cL-03 for gnu-help-gnu-emacs@m.gmane.org; Tue, 06 May 2003 15:50:39 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!unlnews.unl.edu!newsreader.wustl.edu!gumby.it.wmich.edu!out.nntp.be!propagator2-sterling!news-in-sterling.newsfeed.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!uunet!ash.uu.net!spool0900.news.uu.net!reader0901.news.uu.net!not-for-mail Original-Newsgroups: gnu.emacs.help X-Newsreader: Gnus v5.7/Emacs 20.7 Original-Lines: 17 Original-NNTP-Posting-Host: 199.172.169.15 Original-X-Trace: 1052250409 reader1.ash.ops.us.uu.net 15626 199.172.169.15 Original-Xref: shelby.stanford.edu gnu.emacs.help:112862 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:9362 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:9362 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))))