;;; -*- Mode:LISP; Package:ZWEI; Base:10; Readtable:ZL -*-


(defun comp (str list &aux alist)
  (setq alist
	(make-array (length list) :type 'art-q-list :fill-pointer T
		    :initial-contents (sort list #'string-lessp :key #'car)))
  (PRINT ALIST)
  (multiple-value-bind (answer all ok)
      (complete-string str alist '(#\space #\return))
    (format t "~&Wanted ~S found ~S" str answer)
    (format t "~:[ <failed>~;~2&Completions: ~S~]" ok all)))

(comp "tool" '(("fool"  fool) ("zool"  zool) ("tool"  tool) ("toolish"  toolish) ("tuna" tuna)))


