[STUMP] please critique my code

Tamas Papp <[email protected]>
Newsgroups gmane.comp.window-managers.stumpwm.devel
Message-ID <[email protected]>
Hi,

I am a new to Stumpwm, enjoying it immensely (frankly, I don't use CL
lot these days for work any more, and I kind of miss it). I am now
writing small scripts, learning from reading the sources, and I wonder
if I could get some critique of my code. In particular, is the following
idiomatic? Does it violate any implicit assumptions? As far as I could
see, SORT-WINDOWS is already sorted, and window numbers are required to
be nonnegative integers, so there should be no clashes.

(defcommand renumber-windows (&optional (group (current-group))) ()
  "Assign contiguous numbers to windows in GROUP, starting from 0. "
  (let ((windows (sort-windows group)))
    (loop for window in windows
          for i from 0
          do (setf (window-number window) i)))
  (values))

Best,

Tamas
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.