Monthly Archives: February 2009

A Tiny Lisp Script

A tiny Lisp script, noticed first in a recent post in comp.lang.lisp and then ported to SBCL:

% cat ~/bin/iota
#!/usr/local/bin/sbcl --script

(defun iota (count &optional (start 0) (step 1))
  "Build a list of `count' numbers, starting from `start' and
incrementing by `step' between successive elements."
  (loop repeat count for i from start by step collect i))

(format t "~{~a~^ ~}~%"
        (apply 'iota (mapcar #'read-from-string (rest *posix-argv*))))

Running this from a shell prompt works fine in SBCL 1.0.25:

% iota 10
0 1 2 3 4 5 6 7 8 9
% iota 10 1
1 2 3 4 5 6 7 8 9 10

It even works with float step values, which is a bit cool:

% iota 10 0 1d-2
0 0.01d0 0.02d0 0.03d0 0.04d0 0.05d0 0.06d0 0.07d0 0.08d0 0.09d0
Advertisements

Stalking Keramida

Quick tip for finding if keramida’s been active in a machine the last few days.

Run the command:

% ps xau | sed -n -e 1p -e /sed/d -e '/keramida.*emacs.*daemon/p'

Watch for activity in the Emacs daemon, and if you see any, well… you know that keramida is active :-)

Contributing to FreeBSD

As part of the FreeBSD team, I often get asked the same question: “How can I get started as a FreeBSD contributor?”

There are usually two reasons why a new contributor feels overwhelmed by the idea of getting started. One of them is that he or she feels that it is difficult to find out exactly how to start contributing to a free software project. The second reason is usually a feeling of impotency, the notion that “I am such a newbie, how could I ever make a difference in such a large project?”

Both of these concerns can be addressed quite easily. This post is my attempt at recording what I have learned by being a part of the FreeBSD team for almost a decade now, so let me start by the most serious one of these two obstacles to becoming a FreeBSD contributor: the feeling of being too small to make a difference. Continue reading