[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [STUMP] Feedback and bugfixes
From: |
Philippe Brochard |
Subject: |
Re: [STUMP] Feedback and bugfixes |
Date: |
Mon, 06 Mar 2006 15:42:18 +0100 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) |
Philippe Brochard a écrit :
I answer to myself :)
[...]
> PS: I've tested the last hack with clisp and cmucl. All works fine
> with cmucl but I can't compile it with clisp. I got this :
>
> -- clisp load.lisp --
> ;; Loading file /home/phil/local/stumpwm-cvs/stumpwm-cvs/stumpwm/user.fas ...
> *** - POSITION-IF: :START should be an integer >=0, not NIL
> The following restarts are available:
> SKIP :R1 skip 29 72 (DEFVAR *ROOT-MAP* (LET # # ...) ...)-2
> STOP :R2 stop loading file
> /home/phil/local/stumpwm-cvs/stumpwm-cvs/stumpwm/user.fas
> RETRY :R3 Retry performing #<ASDF:LOAD-OP NIL #x2046B2F6> on
> #<ASDF:CL-SOURCE-FILE "user" #x2046CAE6>.
> ACCEPT :R4 Continue, treating #<ASDF:LOAD-OP NIL #x2046B2F6> on
> #<ASDF:CL-SOURCE-FILE "user" #x2046CAE6> as having been successful.
> SKIP :R5 skip (OOS 'LOAD-OP STUMPWM)
> STOP :R6 stop loading file
> /home/phil/local/stumpwm-cvs/stumpwm-cvs/stumpwm/load.lisp
> ABORT :R7 ABORT
> Break 1 STUMPWM[2]>
> The following special variables were defined too late:
> STUMPWM::*TOP-MAP*
> 0 errors, 34 warnings
> ---------------------
>
The problem is with the #\Space key, split-string complain because the
first position-if return nil with " " as string.
I found this as a workaround, but I'm sure there is a more elegant
loop way.
----------------------------------------------------------------------
(defun split-string (string &optional (separators "
"))
[snip doc string]
;; FIXME: This let is here because movitz doesn't 'lend optional'
(let ((seps separators))
(labels ((sep (c)
(find c seps :test #'char=)))
(if (position-if (complement #'sep) string)
(loop for i = (or (position-if (complement #'sep) string) 0)
then (position-if (complement #'sep) string :start j)
while i
as j = (position-if #'sep string :start i)
collect (subseq string i j)
while j)
(list string)))))
----------------------------------------------------------------------
Philippe
--
Philippe Brochard <address@hidden>
http://hocwp.free.fr
-=-= http://www.gnu.org/home.fr.html =-=-