[slime-devel] [NEW] all-logical-hosts

Terje Norderhaug terje at in-progress.com
Fri Jul 3 23:14:32 UTC 2009


I am making a logical pathname inspector for use with Swank.

Common LISP provides #'logical-pathname-translations that works on  
the name of a logical host. However, it assumes that the developer  
already know the hostnames. However, Common LISP does not provide a  
function to get all logical hostnames.

I suggest adding a function to Swank to discover the names of all  
logical hosts. Here is a candidate with implementations for Clozure  
and LispWorks:

;; swank-backend.lisp

(definterface all-logical-hosts ()
   "Return a list of the names of all logical hosts"
   NIL)

;; swank-openmcl.lisp

(defimplementation all-logical-hosts ()
   (mapcar #'car ccl::%logical-host-translations%))

;; swank-lispworks.lisp

(defimplementation all-logical-hosts ()
   (let (result)
    (maphash (lambda (key value)(push key result))
       system::*logical-pathname-translations*)
    result))

;; alternatively:

(defimplementation all-logical-hosts ()
  (loop for key being the hash-keys of system::*logical-pathname- 
translations*
        collect key))


-- Terje Norderhaug




More information about the slime-devel mailing list