stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[STUMP] please critique my code


From: Tamas Papp
Subject: [STUMP] please critique my code
Date: Mon, 07 Dec 2015 15:25:34 +0100
User-agent: mu4e 0.9.15; emacs 24.5.1

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]