all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.