ratpoison-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RP] ratmenu now in debian


From: Jonathan Walther
Subject: [RP] ratmenu now in debian
Date: Mon Oct 1 22:21:03 2001

-----BEGIN PGP SIGNED MESSAGE-----

Thanks to Geregely for giving me advance warning; the
ratmenu program is now in the main Debian distribution.
Rejoice, and all that.

Shawn, when can we see some of that lisp code you are
working on?  The huddled masses want to know.

I got my first common lisp personal database program working;
it looks a little something like this:

(defmacro print-book? () 'T)
(defmacro print-book () '(pprint (list category comment isbn location owner 
status title)))

(defmacro with-lists (lists &rest body)
        `(let ,(mapcar #'(lambda (s) `(,s ())) lists)
                ,@(mapcar #'(lambda (s) `(defun ,s (data) (setf ,s (cons data 
,s)))) lists)
                ,@body))

(defmacro with-strings (strings &rest body)
        `(let ,(mapcar #'(lambda (s) `(,s "")) strings)
                ,@(mapcar #'(lambda (s) `(defun ,s (data) (setf ,s data))) 
strings)
                ,@body))

(defmacro book (&rest data)
        `(with-lists (category comment)
                (with-strings (isbn location owner status title)
                        ,@data
                        (if (print-book?) (print-book)))))

(load "db")

(quit)

That is just the program; an example database looks like this:

(book
        (isbn "foo")
        (category "children")
        (category "social engineering")
        (owner "Brawny Lothar")
        (location "Temple of Doom")
        (category "x-rated"))
(book
        (isbn "bar")
        (category "ickle")
        (title "fundamentals of computing"))

Jonathan

- --
I am working to subvert from within ...
umm ...  by writing shoddy code ... and
charging too much.

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: noconv

iQCVAwUBO7lI08K9HT/YfGeBAQHMqwQAnC6SRKDlem7KlxugOko0YNoT6kX5/f8n
P4lgZC3FJOMNTM8bBf3fRaE98wPIyNqyrdbUeFVJde0MLW4vBo26kivocQPHctwi
k1EPxwmMJYBzMKedt9Lyzy8jDXK0UA73DCZzq7ZkkA7c1S7frah1Kik3WoDafLgd
6MOdEczHs94=
=C6Yg
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]