Subject: CLHS "Data/" subdir [was: ...Unspecified...Kenny... ]
From: (Rob Warnock)
Date: Thu, 15 May 2008 22:02:00 -0500
Newsgroups: comp.lang.lisp
Message-ID: <>
O.k., so Kenny's had his LOGBITP moment ["Why wasn't I told about
logbitp?"] and his MAPHASH/REMHASH moment ["What Part of Unspecified
Does Kenny Not Understand?"]...

Well, now it's my turn: Why didn't anyone tell me about [or more
honestly, why didn't I ever notice] the "Data/" subdirectory in the
CLHS distribution?!? Sheesh! And all this time I've been fighting
a non-problem!  ;-}  ;-}

Background/Explanation: Yesterday, in the thread "Re: What Part
of Unspecified Does Kenny Not Understand?" [which at the point of
my reply had actually morphed into a discussion about versions
of the CLHS and which ones people should/should_not link to],
I wrote the following:

rpw3 said:
| 4. I *prefer* the "long" filenames, since I have a little personal/local
|    web-based CGI "grep" tool [though written in CL, not shell] that does
|    pattern matches against the v4 filenames. [The "8.3" filenames on v.7
|    (LispWorks) are *way* too short to do any meaningful matches on. Ugh.]
|    And since the old Harlequin version (v4?) is what I have on my laptop,
|    when I find a page locally it's just an exchange of URL prefix to
|    convert my local URL to a globally-accessible URL on the ALU site.
| Perhaps the "right" answer is to upload all three versions to some
| neutral, "permanent", super-high-bandwidth site...and offer a choice...
| maybe along with a file...which relates the filenames of all three...e.g.:
|     ...
|     ((:franz_6.2  "dictentr/standard.htm")
|      (:harlequin_v4 "Body/typ_standard-char.html")
|      (:lispworks_v6 "Body/t_std_ch.htm"))
|     ...
| Then people could easily translate from one format to the other.

[Where by "translate" I really meant "translate between the
filename(s) used in one CLHS version for one (or more) topic(s) into
the filename(s) used in a different version for the same topic(s)".]

Well, in some sidebar mail, Kent Pitman has kindly directed my
attention to these three files in the current Lispworks version
of the CLHS:

And sure enough, the old v.4 CLHS on my laptop also has the same three,
albeit with different names:


where the first such file has entries of this sort, for "Data/Map_Sym.txt":


and for the older "Data/Symbol-Table.text":


In either case, using this file is a *much* better thing to do
than trying to search by pattern matching on the filenames as
I'd been doing in the past [as noted in #4 above]. So now I can
get even *better* matching with something as simple as this:

    (let ((symbol-file-map
           (file-lines (strcat +clhs-base+ "Data/Symbol-Table.text"))))
      (with-html-output (s *standard-output* t)
        (loop for (sym file) on symbol-file-map by #'cddr
          when (search pat sym :test #'char-equal)
           do (let ((url (strcat "file://" +clhs-base+ (subseq file 3))))
                (htm (:a (:href url) sym) (lfd))))))

E.g., for an input of "mis" it would output:

    <A HREF='file:///u/rpw3/file/doc/HyperSpec/Body/var_stprint-miser-widthst.html'>*PRINT-MISER-WIDTH*</A>
    <A HREF='file:///u/rpw3/file/doc/HyperSpec/Body/fun_mismatch.html'>MISMATCH</A>
    <A HREF='file:///u/rpw3/file/doc/HyperSpec/Body/stagenfun_slot-missing.html'>SLOT-MISSING</A>

And now I can migrate to v.7 without losing my favorite tool!!

Done. End of story. "D'oh!! Oh what a maroon I've been!"  ;-}  ;-}


Rob Warnock			<>
627 26th Avenue			<URL:>
San Mateo, CA 94403		(650)572-2607