[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Designing interface of a simple elisp function
From: |
Mario Lang |
Subject: |
Re: Designing interface of a simple elisp function |
Date: |
Sun, 13 Oct 2002 00:06:23 GMT |
User-agent: |
Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-debian-linux-gnu) |
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