anchor.diff:                (t (error "Invalid option ~A" opt))))
         (dolist (entry
                   (sort
  -                 (DELETE-DUPLICATES
  +                 (delete-duplicates
                     ;; SBCL RETURNS DIRECTORIES FOR "*" AS WELL AS FOR "*/".
                     (mapcan
                      (lambda (path) (handler-case (directory path) (error () nil)))
  
positive.code:                              path nil))))
  
  
  (DEFUN CHANGE-WORKING-DIRECTORY (PATH)
    (multiple-value-bind (exists-p dirpath) (check-directories-exist path)
      (if exists-p
          (progn
            ;; (print (list path dirpath (truename dirpath)))
            (SETF *WORKING-DIRECTORY* (truename dirpath))
            (DOLIST (HOOK *CHANGE-DIRECTORY-HOOK*)
              (LET ((*WORKING-DIRECTORY* *WORKING-DIRECTORY*))
                (FUNCALL HOOK *WORKING-DIRECTORY*))))
          (error "nonexistent directory: ~S" dirpath)))
    *WORKING-DIRECTORY*)
  
  
    
  (DEFUN PARENT-DIRECTORY (DIRPATH)
    (MAKE-PATHNAME :DIRECTORY (LET ((DIR (PATHNAME-DIRECTORY DIRPATH)))
                                (CONS (CAR DIR) (BUTLAST (CDR DIR))))
                   :defaults dirpath))
  
  
  (DEFUN SUBDIRECTORIES (DIRPATH)
    (DIRECTORY
     (merge-pathnames (MAKE-PATHNAME :DIRECTORY '(:RELATIVE :WILD)) DIRPATH)))
  
  
  (DEFUN FILTER-OUT-DOTS (LIST)
    (DELETE-IF
     (LAMBDA (PATH)
       (CHAR= (CHARACTER ".")
              (AREF (OR (PATHNAME-NAME PATH)
                        (CAR (LAST (PATHNAME-DIRECTORY PATH)))) 0)))
     LIST))
  
  
  (DEFUN SUBDIRECTORIES-NAMES (DIRPATH &KEY (KEEP-DOT-FILES *KEEP-DOT-FILES*))
    (LET ((SUBS (SUBDIRECTORIES DIRPATH)))
      (UNLESS KEEP-DOT-FILES  (SETF SUBS (FILTER-OUT-DOTS SUBS)))
      (MAPCAR (LAMBDA (PATH) (CAR (LAST (PATHNAME-DIRECTORY PATH)))) SUBS)))
  
  
  (DEFUN CHILD-DIRECTORY (DIRPATH CHILD)
    (MERGE-PATHNAMES (MAKE-PATHNAME :DIRECTORY (LIST :RELATIVE CHILD)) DIRPATH))
  
  
  (DEFUN FILES (DIRPATH &KEY (TYPE :WILD) (KEEP-DOT-FILES *KEEP-DOT-FILES*))
    (LET ((FILES (DIRECTORY
                  (MAKE-PATHNAME :NAME :WILD :TYPE TYPE :defaults DIRPATH))))
      (UNLESS KEEP-DOT-FILES (SETF FILES (FILTER-OUT-DOTS FILES)))
      (MAPCAR (LAMBDA (PATH) (CONS (PATHNAME-NAME PATH) PATH)) FILES)))
  
  
  (DEFPARAMETER *SCREEN-WIDTH* 80)
  
  (DEFUN PRINT-LIST (STREAM LIST OFFSET &KEY (INDEX-WIDTH 2))
    (LET* ((ITEM-WIDTH (REDUCE (FUNCTION MAX) LIST :KEY (FUNCTION LENGTH)))
           (MAX-WIDTH (+ INDEX-WIDTH 3 ITEM-WIDTH))
           (COL-COUNT (TRUNCATE *SCREEN-WIDTH* MAX-WIDTH))
           (ROW-COUNT (TRUNCATE (+ (LENGTH LIST) COL-COUNT -1) COL-COUNT))
           (TABLE (MAKE-ARRAY (LIST COL-COUNT ROW-COUNT) :INITIAL-ELEMENT ""))
           (X 0) (Y 0))
      (DOLIST (ITEM LIST)
        (SETF (AREF TABLE X Y)
              (FORMAT NIL "~V,D) ~V,A" INDEX-WIDTH OFFSET ITEM-WIDTH ITEM))
        (INCF OFFSET)
        (INCF Y)
        (IF (<= ROW-COUNT Y)
            (SETF X (1+ X) Y 0)))
      (DOTIMES (Y ROW-COUNT)
        (DOTIMES (X (1- COL-COUNT))
          (PRINC (AREF TABLE X Y) STREAM)
          (PRINC " " STREAM))
        (PRINC (AREF TABLE (1- COL-COUNT) Y) STREAM)
        (TERPRI STREAM))))
  
  
  (DEFUN BROWSE ()
    "COMMAND
  DO:         Displays the contents of the working directory and
              allows the user to navigate in the directory tree and
              to load files.
  "
    (LOOP
       (LET* ((SUBDIRS     (SORT (SUBDIRECTORIES-NAMES (WORKING-DIRECTORY))
                                 (FUNCTION STRING<)))
              (FILES       (SORT (FILES (WORKING-DIRECTORY) :TYPE "lisp")
                                 (LAMBDA (A B) (STRING< (CAR A) (CAR B)))))
              (ITEM-COUNT  (+ (LENGTH SUBDIRS) (LENGTH FILES)))
              (COUNT-WIDTH (if (= 0 item-count) 1 (CEILING (LOG ITEM-COUNT 10)))))
         (FORMAT T "~&")
         (FORMAT T "--- current directory ----------------------------~%")
         (FORMAT T "~V,A  ~A~%" COUNT-WIDTH "" (WORKING-DIRECTORY))
         (FORMAT T "--- parent directory ----------------------------~%")
         (FORMAT T "~V,D) ~A~%"
                 COUNT-WIDTH 0 (PARENT-DIRECTORY (WORKING-DIRECTORY)))
         (WHEN SUBDIRS
           (FORMAT T "--- subdirectories -------------------------------~%")
           (PRINT-LIST T SUBDIRS 1 :INDEX-WIDTH COUNT-WIDTH))
         (WHEN FILES
           (FORMAT T "--- files ----------------------------------------~%")
           (PRINT-LIST T (MAPCAR (FUNCTION CAR) FILES)
                       (1+ (LENGTH SUBDIRS)) :INDEX-WIDTH COUNT-WIDTH))
         (FORMAT T "--------------------------------------------------~%")
         (LET ((ANSWER
                (BLOCK :ANSWER
                  (LOOP
                     (FORMAT T "~&Change directory number, ~
                              load file number, or -1 to quit: ")
                     (FINISH-OUTPUT)
                     (LET ((ANSWER (READ T NIL NIL)))
                       (TYPECASE ANSWER
                         (INTEGER (IF (<= -1 ANSWER ITEM-COUNT)
                                      (RETURN-FROM :ANSWER ANSWER)
                                      (FORMAT T "~&Input out of range.~%")))
                         (OTHERWISE (FORMAT T "~&Bad input type.~%"))))))))
           (COND
             ((= -1 ANSWER) (RETURN))
             ((= 0 ANSWER)
              (CHANGE-WORKING-DIRECTORY (PARENT-DIRECTORY (WORKING-DIRECTORY))))
             ((<= ANSWER (LENGTH SUBDIRS))
              (CHANGE-WORKING-DIRECTORY 
               (CHILD-DIRECTORY (WORKING-DIRECTORY) (ELT SUBDIRS (1- ANSWER)))))
             (T (LOAD (CDR (ELT FILES (- ANSWER (LENGTH SUBDIRS) 1)))
                      :VERBOSE T)))))))
      
  
  (defun resolve (path &key (directory nil))
  
negative.code: (defcommand grep)
  
  
  (defvar *keep-dot-files* nil
    "Whether dot-files should be shown.")
  
  (defvar *change-directory-hook*
    (list (lambda (working-directory)
            (setf *default-pathname-defaults*
                  (merge-pathnames working-directory *default-pathname-defaults* nil))))
    "A list of unary functions called with the path of 
     the new current working directory.")
  
  (defvar *working-directory* (truename (user-homedir-pathname))
    "The current working directory")
  
  (defun working-directory () *working-directory*)
  
  (defun check-directories-exist (path)
    "Return: whether all the directories in PATH exist;
  