unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Designing interface of a simple elisp function
@ 2002-10-12 15:39 gnuist006
  2002-10-12 16:15 ` Henrik Motakef
  2002-10-13  0:06 ` Mario Lang
  0 siblings, 2 replies; 4+ messages in thread
From: gnuist006 @ 2002-10-12 15:39 UTC (permalink / raw)


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.

(b2d '(1 0 1 0 0 1)) is hardly readible or desirable.
(b2d '101001)   is most desirable
(b2d "101001")  is tolerable if this is the best that can be done

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-10-13  0:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-12 15:39 Designing interface of a simple elisp function gnuist006
2002-10-12 16:15 ` Henrik Motakef
2002-10-13  0:24   ` Edward O'Connor
2002-10-13  0:06 ` Mario Lang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).