From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: zghuang@bloomberg.net (Zhengao. Huang) Newsgroups: gmane.emacs.help Subject: list conversion Date: 06 May 2003 15:33:35 -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 1052249861 5503 80.91.224.249 (6 May 2003 19:37:41 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 6 May 2003 19:37:41 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Tue May 06 21:37:32 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 19D8Fn-0001QH-00 for ; Tue, 06 May 2003 21:37:31 +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 19D8ES-00025X-00 for gnu-help-gnu-emacs@m.gmane.org; Tue, 06 May 2003 15:36:08 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!cyclone.bc.net!arclight.uoregon.edu!news.tufts.edu!uunet!dca.uu.net!ash.uu.net!spool0900.news.uu.net!reader0900.news.uu.net!not-for-mail Original-Newsgroups: gnu.emacs.help X-Newsreader: Gnus v5.7/Emacs 20.7 Original-Lines: 16 Original-NNTP-Posting-Host: 199.172.169.15 Original-X-Trace: 1052249615 reader0.ash.ops.us.uu.net 9354 199.172.169.15 Original-Xref: shelby.stanford.edu gnu.emacs.help:112861 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:9353 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:9353 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))))