Archive for November, 2006

New blog

Robin Hanson, Nick Bostrom, Eliezer Yudkowsky, and others have started a new blog, called Overcoming Bias. I highly recommend it.


Emacs and lisp

I’ve just started working on my first really substantial lisp application. It’s going to be the application described in this old post. I’m using CLX and writing my own midi library using device IO to /dev/snd/midi0 (on Linux, of course—using the midi ports on Windows is about a million times harder).

And anyway, it reminded me that I never did publicize the neat parentheses macros I’ve been using to make programming in Lisp with Emacs easier. It works a lot like Eclipse does—when you type an open paren, it inserts the close paren. Then when you type the close paren, it simply moves the cursor past what it had inserted before. That way, if you move around with the cursor, your parens are all still in balance. It doesn’t work perfectly. Typing unmatched parens in strings becomes annoying. And surrounding an existing form(s) in a new form, while easy, isn’t entirely intuitive. What happens is that if the cursor is at an open paren when you type another open paren, it puts another closing paren after the form and puts a space after the open paren you inserted. If you don’t want that to happen, you can type a space before typing the open paren. If you want to grab more than just the one form (or if you’re not right in front of a form or want to grab it anyway) you can type Ctrl+N before the open paren and it will enclose the next N forms. Finally, typing a Ctrl+0 before typing “(” will remove the pair of parentheses at the cursor. Also a bit awkward, but better than nothing.

I’ve found that this makes using Lisp much nicer. Source after the break. Continue reading »