[slime-devel] Re: [slime-cvs] CVS slime

Helmut Eller heller at common-lisp.net
Tue Feb 5 12:41:55 UTC 2008


* mbaringer [2008-02-05 13:06+0100] writes:

>      (save-excursion
>        (when (or (re-search-backward regexp nil t)
>                  (re-search-forward regexp nil t))
> -        (match-string-no-properties 2)))))
> +        ;; package name can be a string designator, convert it to a string.
> +        (slime-eval `(cl:string (cl:second (cl:read-from-string ,(match-string-no-properties 0))))
> +                    "COMMON-LISP-USER")))))

This is bad style for several reasons:

1. slime-eval should only be used in situations where it's impossible
   to use slime-eval-async e.g. for completion because the control
   structure is fixed by Emacs built-ins.

2. the argument to slime-eval should look like 
   (swank:function arg1 arg2 ..) where each argument is a literal and
   not a to-be-evaluated form

3. it uses more than 80 columns

4. it makes a frequently used function much slower 

5. it doesn't handle read-errors

6. it interns random symbols

7. it does useless work, because the result of
   slime-search-buffer-package will be used either with guess-package
   or slime-pretty-package-name.

That's quite a lot for a two line change :-)

Helmut.



More information about the slime-devel mailing list