Re: What are you doing in Common Lisp lately?
Posted: Tue Jul 08, 2008 6:07 am
I'm writing a card-scanner configuration tool for my company. We have about 20 retirement communities, and are using three different types of proximity ID cards. Each type has its own scanner model, and requires its own custom (non-factory) configuration.
One of the sweet things about Lisp (some part of which I could have done in Ruby, my other language) ist that it prints structures in a format Lisp can read back. Thus, rather than custom-code a configuration format, I can take the printed output from a working card reader and include it as a list of configuration settings; Lisp will read it into the correct C-flavored structure (thanks to Swig and clisp).
Then, I can mapcar through the list, applying a generic function set-config to each entry: the GF's methods call the correct configuration function based on the structure that Lisp re-created from the original config output.
This gives me bit-level access to the configurations, without having to hand-code a config-to-struct transform, etc. In addition, the configuration entries are readable, since the Lisp structure I/O is readable: instead of
as in my original Ruby implementation, I can represent (one part of this) like
I also have used Lisp and Parenscript with Hunchentoot to generate the first cut of a new employees display page, which provided a slideshow of new employees.
One of the sweet things about Lisp (some part of which I could have done in Ruby, my other language) ist that it prints structures in a format Lisp can read back. Thus, rather than custom-code a configuration format, I can take the printed output from a working card reader and include it as a list of configuration settings; Lisp will read it into the correct C-flavored structure (thanks to Swig and clisp).
Then, I can mapcar through the list, applying a generic function set-config to each entry: the GF's methods call the correct configuration function based on the structure that Lisp re-created from the original config output.
This gives me bit-level access to the configurations, without having to hand-code a config-to-struct transform, etc. In addition, the configuration entries are readable, since the Lisp structure I/O is readable: instead of
Code: Select all
BIT_SETTINGS = [[0,0,16,26], [1,1,16,26], [1,1,25,32]]
Code: Select all
(defvar mt-config
(list #S(PCPROX-API::ID-BIT-COUNTS :LEAD-PARITY 1
:TRAILING-PARITY 1
:ID 16
:TOTAL 26
:IPAD4 0
:IPAD5 0
:IPAD6 0
:IPAD7 0)
...))