1
0
mirror of synced 2026-05-09 09:09:53 +00:00

For prefix ties, choose the smaller pseudohost, to make it deterministic

This commit is contained in:
rmkaplan
2026-04-28 21:40:13 -07:00
parent beb6110f14
commit efa423e016
2 changed files with 22 additions and 18 deletions

View File

@@ -1,15 +1,12 @@
(DEFINE-FILE-INFO :PACKAGE "INTERLISP" :READTABLE "INTERLISP" :BASE 10)
(FILECREATED "27-Apr-2026 22:55:50" {WMEDLEY}<library>PSEUDOHOSTS.;190 30619
(FILECREATED "28-Apr-2026 08:31:30" {WMEDLEY}<library>PSEUDOHOSTS.;191 30987
:EDIT-BY rmk
:CHANGES-TO (FNS CDPSEUDO CONTRACT.PH PSEUDOHOST PSEUDOHOSTP PSEUDOFILENAME EXPAND.PH
PSEUDOFILENAMES)
(VARS PSEUDOHOSTSCOMS)
(RECORDS TARGETDEVICE)
:CHANGES-TO (FNS PSEUDOHOST)
:PREVIOUS-DATE "26-Apr-2026 10:31:30" {MEDLEY}<library>PSEUDOHOSTS.;188)
:PREVIOUS-DATE "27-Apr-2026 22:55:50" {MEDLEY}<library>PSEUDOHOSTS.;190)
(PRETTYCOMPRINT PSEUDOHOSTSCOMS)
@@ -41,7 +38,7 @@
(PSEUDOHOST
[LAMBDA (HOST PREFIX CDSUFFIX NOERROR)
(* ;; "Edited 27-Apr-2026 17:33 by rmk")
(* ;; "Edited 28-Apr-2026 08:31 by rmk")
(* ;; "Edited 25-Apr-2026 15:51 by rmk")
@@ -120,7 +117,7 @@
GETFILEINFO _ (FUNCTION GETFILEINFO.PH)
SETFILEINFO _ (FUNCTION SETFILEINFO.PH)))
(* ;; "The ultimate target device keeps a map of prefixes and the hostnames they map to. The longest matching prefix is chosen when a name that expands to the target device is contracted, unless a PHHOST preference is provided.")
(* ;; "The ultimate target device keeps a map of prefixes and the hostnames they map to. If a PHOST preference isn't provided and two prefixes have common initial substrings, choose the one that provides the smallest file name. ")
(UNINTERRUPTABLY
[change (fetch (TARGETDEVICE PREFIXMAPS) OF TARGETDEVICE)
@@ -130,8 +127,15 @@
'<))
DATUM)
(FUNCTION (LAMBDA (P1 P2)
(IGREATERP (NCHARS (CADR P1))
(NCHARS (CADR P2])]
(* ;; "To give smallest file names, longest prefix comes first. If same length (synonyms), the one with the smallest host comes first. So MEDLEY before WMEDLEY")
(if (IGREATERP (NCHARS (CADR P1))
(NCHARS (CADR P2)))
elseif (EQ (NCHARS (CADR P1))
(NCHARS (CADR P2)))
then (ILESSP (NCHARS (CAR P1))
(NCHARS (CAR P2])]
elseif (PSEUDOHOSTP HOST)
then
(* ;; "\DEFINEDEVICE removes the name-mapping but doesn't remove the device. Maybe that's on purpose for other devices, but not here.")
@@ -569,12 +573,12 @@
)
)
(DECLARE%: DONTCOPY
(FILEMAP (NIL (1308 14367 (PSEUDOHOST 1318 . 7880) (PSEUDOHOSTP 7882 . 8801) (PSEUDOHOSTS 8803 . 9164)
(TARGETHOST 9166 . 10035) (TRUEDEVICE 10037 . 10993) (TRUEFILENAME 10995 . 12282) (PSEUDOFILENAME
12284 . 13696) (PSEUDOFILENAMES 13698 . 14365)) (14368 15517 (CDPSEUDO 14378 . 15515)) (15545 21429 (
EXPAND.PH 15555 . 16861) (CONTRACT.PH 16863 . 19345) (UNSLASHIT 19347 . 21093) (GETHOSTINFO.PH 21095
. 21427)) (21430 28051 (OPENFILE.PH 21440 . 22565) (GETFILENAME.PH 22567 . 22965) (DIRECTORYNAMEP.PH
22967 . 23591) (CLOSEFILE.PH 23593 . 24060) (REOPENFILE.PH 24062 . 24738) (DELETEFILE.PH 24740 . 25024
) (GENERATEFILES.PH 25026 . 26220) (GETFILEINFO.PH 26222 . 26743) (SETFILEINFO.PH 26745 . 27054) (
NEXTFILEFN.PH 27056 . 27772) (FILEINFOFN.PH 27774 . 28049)))))
(FILEMAP (NIL (1128 14735 (PSEUDOHOST 1138 . 8248) (PSEUDOHOSTP 8250 . 9169) (PSEUDOHOSTS 9171 . 9532)
(TARGETHOST 9534 . 10403) (TRUEDEVICE 10405 . 11361) (TRUEFILENAME 11363 . 12650) (PSEUDOFILENAME
12652 . 14064) (PSEUDOFILENAMES 14066 . 14733)) (14736 15885 (CDPSEUDO 14746 . 15883)) (15913 21797 (
EXPAND.PH 15923 . 17229) (CONTRACT.PH 17231 . 19713) (UNSLASHIT 19715 . 21461) (GETHOSTINFO.PH 21463
. 21795)) (21798 28419 (OPENFILE.PH 21808 . 22933) (GETFILENAME.PH 22935 . 23333) (DIRECTORYNAMEP.PH
23335 . 23959) (CLOSEFILE.PH 23961 . 24428) (REOPENFILE.PH 24430 . 25106) (DELETEFILE.PH 25108 . 25392
) (GENERATEFILES.PH 25394 . 26588) (GETFILEINFO.PH 26590 . 27111) (SETFILEINFO.PH 27113 . 27422) (
NEXTFILEFN.PH 27424 . 28140) (FILEINFOFN.PH 28142 . 28417)))))
STOP

Binary file not shown.