Zach Beane Common Lisp
111 FOLLOWERS
Zach Beane is working on Common Lisp since 2001. In 2010, he made Quicklisp, the most popular library manager for Common Lisp.
Zach Beane Common Lisp
4y ago
Sometimes I like to have a short function call to make a lookup table with arbitrary keys and values. Something like this:
(table "name" "Alice" "age" 42) => #<TABLE ...>
This is easy enough to define like so:
(defun table (&rest keys-and-values) ;;; loop over keys and values to construct a table ...)
But there’s another option that works:
(defun table (&rest keys-and-values &key &allow-other-keys) ...)
This version has the advantage that missing arguments (e.g. (table "name")) are caught at compile-time!
I’ve been using this construct for a few years, but rec ..read more
Zach Beane Common Lisp
4y ago
The latest SBCL handles slot :initform and :type options in a new way. It’s mentioned in the release notes.
minor incompatible change: the compiler signals a warning at compile-time when an initform of T, NIL or 0 does not match a STANDARD-CLASS slot’s declared type._
Sounds pretty benign, but it breaks dozens of projects in Quicklisp. (To be fair, most of the failures are caused by a small number of core systems on which many other systems depend.)
Here’s an example of the new behavior:
(defclass foo () ((name :type string :initform nil)))
With the above defclass form, SBCL 2.0.9 will si ..read more
Zach Beane Common Lisp
5y ago
Ultralisp.org has a great new search system. It indexes the docstrings of all the Ultralisp projects, and as a result it is very easy to search for specific functionality and get useful results. For example, I wanted to see what projects have base64-related functions, and now it’s just a simple search away. I highly recommend it ..read more
Zach Beane Common Lisp
5y ago
Last week I attended the SBCL 20th anniversary
workshop, held in Vienna, Austria. Here
are some rough impressions - I wish I had detailed enough notes to
recreate the experience for those who did not attend, but alas, this
is what you get! It’s incomplete and I’m sorry if I’ve left out
someone unfairly - you have to go yourself next time so you don’t miss
a thing.
Structure of the gathering
I didn’t go to SBCL10, so I didn’t know what to expect. There were few
speakers announced, and I worried (to myself) that this was a sign of
insufficient participation, but I couldn’t have been more wrong ..read more
Zach Beane Common Lisp
5y ago
The Planet Lisp twitter fix involved tracking post status with a
file. Although it’s not 100% bulletproof, there’s a trick when using
files to reduce races.
Here’s a naive approach:
Assign a Planet Lisp post a unique pathname
If that pathname exists, do nothing
Otherwise, send a tweet for the post and save its details to the
pathname
The problem is between 2 and 3 - another process could post the tweet
first.
There’s another option:
Assign a Planet Lisp post a unique pathname
Attempt to open the file with
O_EXCL|O_CREAT mode
If the attempt succeeds, send a tweet for the post and save its
d ..read more
Zach Beane Common Lisp
5y ago
I brought the @planet_lisp Twitter
account back to life after more than a year of dormancy. It updates
twitter with every item on Planet Lisp.
It broke a while back because of how I used Twitter itself to keep
track of what had been posted. I updated it to use a local data
directory
instead. It’s working well so far ..read more
Zach Beane Common Lisp
5y ago
Every 90 days my letsencrypt certificate
expires and I renew it manually. I have to cut and paste data from the
certbot script into repl forms to serve the right data on the right
path and it’s such a pain that sometimes I put it off until after it
expires, and people email me about it, and I feel bad.
The manual process looks something like this (not my actual domain or
challenges):
# certbot certonly --manual -d my.example.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator manual, Installer None
Cert is due for renewal, auto-renewing...
Renewing a ..read more
Zach Beane Common Lisp
5y ago
I really like this comment from Stas Boukarev on Methods or Functions, when do I use which on reddit:
[You] don’t make an extensible program by just making each function generic, if each function still makes some assumption on the data. You can’t say “oh, it’s extensible, but you have to define a hundred methods of your own”, an extensible protocol will require defining a handful of pertinent methods and then the hundred of other functions will automatically work on new classes ..read more
Zach Beane Common Lisp
5y ago
Want to write Common Lisp for RavenPack? | R. Matthew Emerson ..read more