From efa423e016bd0cbae9816b88689b5783a6f2c468 Mon Sep 17 00:00:00 2001 From: rmkaplan Date: Tue, 28 Apr 2026 21:40:13 -0700 Subject: [PATCH] For prefix ties, choose the smaller pseudohost, to make it deterministic --- library/PSEUDOHOSTS | 40 +++++++++++++++++++++------------------ library/PSEUDOHOSTS.LCOM | Bin 8896 -> 8811 bytes 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/library/PSEUDOHOSTS b/library/PSEUDOHOSTS index 2ab1a3f2..5cfb61c6 100644 --- a/library/PSEUDOHOSTS +++ b/library/PSEUDOHOSTS @@ -1,15 +1,12 @@ (DEFINE-FILE-INFO :PACKAGE "INTERLISP" :READTABLE "INTERLISP" :BASE 10) -(FILECREATED "27-Apr-2026 22:55:50" {WMEDLEY}PSEUDOHOSTS.;190 30619 +(FILECREATED "28-Apr-2026 08:31:30" {WMEDLEY}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}PSEUDOHOSTS.;188) + :PREVIOUS-DATE "27-Apr-2026 22:55:50" {MEDLEY}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 diff --git a/library/PSEUDOHOSTS.LCOM b/library/PSEUDOHOSTS.LCOM index 12797ee1dc6cb8ce360fa3c353e8d03b5edd87c4..0252b14692c318f2e613bc6d1ea3923330124f47 100644 GIT binary patch delta 1306 zcmZWpO>f*p81C+(Hmo>oXb~x=2h*bDu-*Ca=L(@Xo^fruYg=P)NKj6+k*J_F3Kt|Q z_JlZaY2<&vKR~4y#DOa(#6RH90k|R|@!H-bTkvIO-q-Vdyz|cdq<>dW53c*;@Z@wX zm~g@TspM1JJNsB@zJsA9){|_?_*A+UK0H0X|M=0#!%vPM;P~^C)6Z^CQIvY2@+2=S zJp2?^yqL`({IlP-y#GPiwzV_dj?sl(2`xK$_pw|jp5xc^%5{Pu3Y_wp6`!qxca_pk1*BHi%M zU!yDA4o4Oxp($b8=QDXRqZ+NU_1FC$Uq=idM~xFjaw1*spkHtF>U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