Category Archives: Programming

My Solution to the Last Elisp Challenge

The challenge was to convert the output from dstat so that all the bytes values (some of which are given as kilobytes or megabytes) to just bytes. Thus, 2k would become 2048 and 3M would become 3145728. Similarly, dstat outputs … Continue reading

Posted in Programming | Tagged , | Leave a comment

Regular Expressions and Emacs Lisp

Over at What keramida said…, Giorgos Keramidas poses an interesting problem. Given the following output from dstat, get rid of the B, k, and M suffixes by converting them into bytes. —-system—- —-total-cpu-usage—- –net/eth0- -dsk/total- sda- time |usr sys idl … Continue reading

Posted in Programming | Tagged , | 3 Comments

Quickdocs Documentation

Quickdocs keeps getting better and better. Now they have nicely formatted documentation for the Quicklisp packages. These are nice enough and easy enough to access that I use them for my primary package documentation. They’re a lot easier to bring … Continue reading

Posted in Programming | Tagged , | Leave a comment

Lisp Web Tales

Pavel Penev is writing a book, Lisp Web Tales, about Web applications and Common Lisp. He describes it as a set of tutorials and examples. I’ve been meaning to write about this for some time because it seems like a … Continue reading

Posted in Programming | Tagged , | Leave a comment

SBCL 1.1.8 Is Out

I just updated my Common Lisp system, SBCL, to the latest version, 1.1.8. Between now and the last update, I had upgraded OS X to Mountain Lion. That, of course, meant that I had to reload GCC and the other … Continue reading

Posted in Programming | Tagged , | Leave a comment

Tail Call Optimization in Elisp

If you’ve got a Lisp background—especially a Scheme background—you may have internalized recursion as a looping mechanism and general programming strategy. That doesn’t work with Elisp, of course, because each recursive invocation allocates a stack frame. Not to worry, though, … Continue reading

Posted in Programming | Tagged , | 2 Comments

The Emacs defadvice Macro

Evgkeni Sampelnikof has posted a nice introduction to defadvice. Emacs is all about having it your way and making it easy to do so. Very often it’s convenient to change the behavior of a built in command and since Emacs … Continue reading

Posted in Programming | Tagged | 1 Comment

DSLs

I have a long standing love affair with Domain Specific Languages (DSLs). Back when I was writing in C, I wrote several compilers and associated interpreters for various DSLs. This mainly involved using fairly heavyweight tools like lex and yacc … Continue reading

Posted in Programming | Tagged , | Leave a comment

The Coding Standard From Hell

You say you hate your organization’s coding standards? You say they make the code harder to understand and maintain? You say they could only have been devised by a particularly moronic version of the pointy haired boss? Stop your whining … Continue reading

Posted in Programming | Leave a comment

Emacs Hash Tables

One of the most useful data structures in Computer Science is the hash table. I’ve been using them for my entire career and have implemented close to a hundred instances in several languages. That’s not as necessary these days as … Continue reading

Posted in Programming | Tagged , | Leave a comment