From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Mario Lang Newsgroups: gmane.emacs.help Subject: Re: Designing interface of a simple elisp function Date: Sun, 13 Oct 2002 00:06:23 GMT Organization: delYsid CyberMedia Sender: help-gnu-emacs-admin@gnu.org Message-ID: <87y9939p76.fsf@lexx.delysid.org> References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1034467980 3469 127.0.0.1 (13 Oct 2002 00:13:00 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 13 Oct 2002 00:13:00 +0000 (UTC) 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 180WNO-0000tp-00 for ; Sun, 13 Oct 2002 02:12: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) id 180WLi-0005lG-00; Sat, 12 Oct 2002 20:11:14 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.stueberl.de!newsfeed.eunet.at!newsfeed.austria.eu.net!newsrouter.chello.at!news.chello.at.POSTED!53ab2750!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs X-Face: #{U(u[E+u(XLt(Fzy^$\*@|~Op>;RH\Ff0gJmj>d/,E`SdhiT|GvS"x8J)&RXP@_r8o\;W+ "n|c..jN7_r:3AZZXUylgIc.w_TGBCWNS8.^Fo<]Mwl-[(xVfz(>#*]HT7Kjm.0<"2J]npj?_ig&%X 5Un,^Rie4K9b'j?l^Utlpa7>~0%GF0%[Dyt=f)oD:K4s81Hs9'GH0\kP+3hNtF-D List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:2532 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:2532 gnuist006@hotmail.com (gnuist006) writes: > I want to write a function, say converting a binary to decimal in lisp. > For arbitrary length binary, I want the input as a string, which is what > we do in C. Then I want to get "car" of the string and go from there. > This is like getchar or getc in C. > Now this "car" does not apply to a string but to a list. On the other > hand the arbitary length input applies to string. Does there exist > string to list function? But even that also seems cheating. What is the > most elegant way to write such a function so that it is also readible > in use. You are looking for aref: (aref "abc" 1) => 98 C-h f aref RET for more info. -- CYa, Mario