1
0
mirror of synced 2026-04-25 20:01:51 +00:00

Remove calls to openfile (#1333)

* Remove calls to OPENFILE

OPENFILE is a residual Interlisp function that returns a litatom instead of a stream.  In almost all cases, this immediate causes an error that litatom files are no longer supported.  I have found (FINDCALLERS) all the examples in lispusers/sources/library/ and replaced OPENFILE with OPENSTREAM (except for the calls from \PEEKPUP and \PEEKNS, that I didn't track down).  There was a trivai call in COMPILE.FILECHECK in COMPILE, but that function is not called anywhere.  So I removed it.

* ADIR:  remove OPENFILE calls, also another stab at \COPYSYS

With respect to \COPYSYS, this replaces the draft PR #1263.  This applies TRUEFILENAME at the start, but remembers whether it was in fact a pseudohost and restores that for the return value.  So if you start in a pseudo world you end up there.

---------

Co-authored-by: Larry Masinter <lmm@acm.org>
This commit is contained in:
rmkaplan
2023-10-17 21:54:17 -07:00
committed by GitHub
parent 9273cffce2
commit 50dc0a9269
20 changed files with 990 additions and 432 deletions

View File

@@ -1,11 +1,13 @@
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10 FORMAT XCCS)
(FILECREATED " 5-Jul-2021 13:46:39" 
{DSK}<Users>kaplan>Local>medley3.5>git-medley>sources>COMPILE.;4 77731
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
changes to%: (FNS BCOMPL BCOMPL.BODY)
(FILECREATED "24-Sep-2023 13:59:34" {WMEDLEY}<sources>COMPILE.;5 77344
previous date%: " 5-Jul-2021 09:31:55"
{DSK}<Users>kaplan>Local>medley3.5>git-medley>sources>COMPILE.;3)
:EDIT-BY rmk
:CHANGES-TO (VARS COMPILECOMS)
(FNS COMPSET)
:PREVIOUS-DATE " 5-Jul-2021 13:46:39" {WMEDLEY}<sources>COMPILE.;4)
(* ; "
@@ -22,7 +24,7 @@ with the terms of said license.
[(FNS BCOMPL BCOMPL.BODY PRINT-COMPILE-HEADER RESETOPENFILES BCOMPL1A BCOMPL2 BCOMPL3 BLOCK%:
BRECOMPILE BRECOMPILE1 BRECOMPILE2 BRECOMPILE3 BLOCKCOMPILE BLOCKCOMPILE1 COMPSET
COMPSETREAD COMPSETY COMPSETF RCOMP3 TCOMPL RECOMPILE RECOMP? COMPILE COMPILE1 COMPILE1A
SHOULD-BE-DWIMIFIED? COMPILE.FILECHECK COMPEM GETCFILE SPECVARS LOCALVARS GLOBALVARS)
SHOULD-BE-DWIMIFIED? COMPEM GETCFILE SPECVARS LOCALVARS GLOBALVARS)
(ADDVARS (NOLINKFNS HELP ERRORX ERRORSET EVALV FAULTEVAL INTERRUPT SEARCHPDL MAPDL BREAK1
EDITE EDITL)
(LINKFNS)
@@ -72,7 +74,7 @@ with the terms of said license.
(CL:PROCLAIM '(CL:SPECIAL COMPVARMACROHASH))
(CL:PROCLAIM '(GLOBAL SYSSPECVARS SYSLOCALVARS COMPILE.EXT NOTCOMPILEDFILES CLISPARRAY
FILERDTBL DWIMFLG DWIMWAIT LISPXHISTORY]
(COMS (* ; "COMPILEMODE")
(COMS (* ; "COMPILEMODE")
(PROP VARTYPE COMPILEMODELST)
(FNS COMPILEMODE))
(DECLARE%: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS
@@ -1018,26 +1020,19 @@ with the terms of said license.
(RETURN (OR TEM BLKNAME])
(COMPSET
(LAMBDA (FILE FLG) (* bvm%: " 2-Aug-86 16:58")
(* If FILE is not NIL, COMPSET doesn't ask any questions but simply initializes
 the output FILE, LCFIL. If FLG is T (AND FILE IS NIL) COMPSET doesn't ask for
 an output FILE, but does set up LAPFLG, STRF, SVFLG, and LSTFIL.
 -
 -
 BCOMPL and BRECOMPILE both call COMPSET twice, once with FILE NIL and FLG T,
 and once with FILE set to their output FILE.
 -
 COMPILE calls COMPSET only once, with both arguments NIL.)
[LAMBDA (FILE FLG) (* ; "Edited 24-Sep-2023 13:59 by rmk")
(* bvm%: " 2-Aug-86 16:58")
(* ;; "If FILE is not NIL, COMPSET doesn't ask any questions but simply initializes the output FILE, LCFIL. If FLG is T (AND FILE IS NIL) COMPSET doesn't ask for an output FILE, but does set up LAPFLG, STRF, SVFLG, and LSTFIL. --- --- BCOMPL and BRECOMPILE both call COMPSET twice, once with FILE NIL and FLG T, and once with FILE set to their output FILE. --- COMPILE calls COMPSET only once, with both arguments NIL.")
(PROG (OLDO)
(COND
(FILE (GO NT)))
(SELECTQ (SETQ FILE (COMPSETREAD '"listing? " COMPSETKEYLST (OR FLG '(S T %
))))
(S (COND
[SELECTQ [SETQ FILE (COMPSETREAD '"listing? " COMPSETKEYLST (OR FLG '(S T %
]
(S [COND
(LAPFLG (PRIN1 '"file: " T)
(SETQ LSTFIL (COMPSETF (COMPSETREAD)))))
(SETQ LSTFIL (COMPSETF (COMPSETREAD]
(GO NOCHANGE))
((ST STF)
(SETQ LAPFLG NIL)
@@ -1055,34 +1050,33 @@ with the terms of said license.
(PRIN1 '"file: " T)
(SETQ FILE (COMPSETREAD)))
NIL)
(SETQ LSTFIL (COMPSETF FILE)))))
(COND
((SETQ STRF (COMPSETY (COMPSETREAD '"redefine? ")))
(SETQ SVFLG (COMPSETY (COMPSETREAD '"save exprs? ")))))
(SETQ LSTFIL (COMPSETF FILE]
[COND
([SETQ STRF (COMPSETY (COMPSETREAD '"redefine? "]
(SETQ SVFLG (COMPSETY (COMPSETREAD '"save exprs? "]
NOCHANGE
(COND
((AND LAPFLG (NEQ LSTFIL 'T)
(NOT (OPENP LSTFIL 'OUTPUT)))
(SETQ LSTFIL1 (SETQ LSTFIL (OPENFILE LSTFIL 'OUTPUT 'NEW NIL '((TYPE TEXT)))))
(* LSTFIL1 is set when the file is opened for this compilation.
 in this case it will be closed when the compilation is finished or aborttd.)
([AND LAPFLG (NEQ LSTFIL 'T)
(NOT (OPENP LSTFIL 'OUTPUT]
[SETQ LSTFIL1 (SETQ LSTFIL (OPENSTREAM LSTFIL 'OUTPUT 'NEW '((TYPE TEXT]
(* ;; "LSTFIL1 is set when the file is opened for this compilation. in this case it will be closed when the compilation is finished or aborttd.")
)
(T (SETQ LSTFIL1 NIL)))
(COND
((AND (NULL FLG)
([AND (NULL FLG)
(COMPSETY (COMPSETREAD '"output file? " NIL '(N %
))))
]
(PRIN1 '"file name: " T)
(SETQ FILE (COMPSETREAD)))
(T (SETQ FILE NIL)))
NT (COND
NT [COND
((AND (SETQ LCFIL (COMPSETF FILE))
(NEQ LCFIL T))
(SETQ LCFIL (OR (OPENP LCFIL 'OUTPUT)
(OPENSTREAM LCFIL 'OUTPUT 'NEW NIL '((TYPE BINARY)))))))
(RETURN 'DONE))))
(OPENSTREAM LCFIL 'OUTPUT 'NEW '((TYPE BINARY]
(RETURN 'DONE])
(COMPSETREAD
(LAMBDA (MESS KEYLST DEFAULT) (* wt%: "23-AUG-80 01:29")
@@ -1309,10 +1303,6 @@ with the terms of said license.
FINALLY (RETURN (EQ (CAR FORM)
'CLISP%:])
(COMPILE.FILECHECK
(LAMBDA (FILE) (* lmm "11-Jul-84 17:27")
(OPENFILE FILE 'INPUT)))
(COMPEM
(LAMBDA (X Y ERRORFLG FL) (* wt%: " 7-JUL-78 13:07")
@@ -1414,15 +1404,13 @@ with the terms of said license.
THEN (SETQ GLOBALVARS (UNION A GLOBALVARS])
)
(ADDTOVAR NOLINKFNS HELP ERRORX ERRORSET EVALV FAULTEVAL INTERRUPT SEARCHPDL MAPDL BREAK1 EDITE
EDITL)
(ADDTOVAR NOLINKFNS HELP ERRORX ERRORSET EVALV FAULTEVAL INTERRUPT SEARCHPDL MAPDL BREAK1 EDITE EDITL)
(ADDTOVAR LINKFNS )
(ADDTOVAR FREEVARS )
(ADDTOVAR SYSSPECVARS HELPCLOCK LISPXHIST RESETSTATE OLDVALUE UNDOSIDE0 SPECVARS LOCALVARS
GLOBALVARS)
(ADDTOVAR SYSSPECVARS HELPCLOCK LISPXHIST RESETSTATE OLDVALUE UNDOSIDE0 SPECVARS LOCALVARS GLOBALVARS)
(ADDTOVAR SYSLOCALVARS )
@@ -1455,16 +1443,16 @@ with the terms of said license.
(RPAQ? COMPSETLST '(ST F STF S Y N 1 2 NIL T))
(RPAQ? COMPSETKEYLST '((ST "ore and redefine " KEYLST ("" (F . "orget exprs")))
(S . "ame as last time")
(F . "ile only")
(T . "o terminal")
(1)
(2)
(Y . "es")
(N . "o")))
(S . "ame as last time")
(F . "ile only")
(T . "o terminal")
(1)
(2)
(Y . "es")
(N . "o")))
(RPAQ? COMPSETDEFAULTKEYLST '((Y . "es")
(N . "o")))
(N . "o")))
(RPAQ? BCOMPL.SCRATCH '{CORE}BCOMPL.SCRATCH)
@@ -1490,8 +1478,8 @@ with the terms of said license.
(DECLARE%: EVAL@COMPILE
(PUTPROPS DIGITCHARP MACRO [LAMBDA (CHAR)
(AND (IGEQ CHAR (CHARCODE 0))
(ILEQ CHAR (CHARCODE 9])
(AND (IGEQ CHAR (CHARCODE 0))
(ILEQ CHAR (CHARCODE 9])
)
(DECLARE%: DOEVAL@COMPILE DONTCOPY
@@ -1546,14 +1534,14 @@ with the terms of said license.
)
(PUTPROPS COMPILE COPYRIGHT ("Venue & Xerox Corporation" T 1984 1985 1986 1987 1988 1989 1990 2021))
(DECLARE%: DONTCOPY
(FILEMAP (NIL (3770 74020 (BCOMPL 3780 . 5430) (BCOMPL.BODY 5432 . 12011) (PRINT-COMPILE-HEADER 12013
. 13076) (RESETOPENFILES 13078 . 13431) (BCOMPL1A 13433 . 19446) (BCOMPL2 19448 . 26263) (BCOMPL3
26265 . 27614) (BLOCK%: 27616 . 28248) (BRECOMPILE 28250 . 43239) (BRECOMPILE1 43241 . 49093) (
BRECOMPILE2 49095 . 49897) (BRECOMPILE3 49899 . 51275) (BLOCKCOMPILE 51277 . 53137) (BLOCKCOMPILE1
53139 . 58224) (COMPSET 58226 . 60989) (COMPSETREAD 60991 . 62302) (COMPSETY 62304 . 62428) (COMPSETF
62430 . 62596) (RCOMP3 62598 . 64305) (TCOMPL 64307 . 64606) (RECOMPILE 64608 . 64691) (RECOMP? 64693
. 65153) (COMPILE 65155 . 67144) (COMPILE1 67146 . 67734) (COMPILE1A 67736 . 69383) (
SHOULD-BE-DWIMIFIED? 69385 . 70074) (COMPILE.FILECHECK 70076 . 70222) (COMPEM 70224 . 70948) (GETCFILE
70950 . 72681) (SPECVARS 72683 . 73238) (LOCALVARS 73240 . 73814) (GLOBALVARS 73816 . 74018)) (76481
77430 (COMPILEMODE 76491 . 77428)))))
(FILEMAP (NIL (3708 73744 (BCOMPL 3718 . 5368) (BCOMPL.BODY 5370 . 11949) (PRINT-COMPILE-HEADER 11951
. 13014) (RESETOPENFILES 13016 . 13369) (BCOMPL1A 13371 . 19384) (BCOMPL2 19386 . 26201) (BCOMPL3
26203 . 27552) (BLOCK%: 27554 . 28186) (BRECOMPILE 28188 . 43177) (BRECOMPILE1 43179 . 49031) (
BRECOMPILE2 49033 . 49835) (BRECOMPILE3 49837 . 51213) (BLOCKCOMPILE 51215 . 53075) (BLOCKCOMPILE1
53077 . 58162) (COMPSET 58164 . 60861) (COMPSETREAD 60863 . 62174) (COMPSETY 62176 . 62300) (COMPSETF
62302 . 62468) (RCOMP3 62470 . 64177) (TCOMPL 64179 . 64478) (RECOMPILE 64480 . 64563) (RECOMP? 64565
. 65025) (COMPILE 65027 . 67016) (COMPILE1 67018 . 67606) (COMPILE1A 67608 . 69255) (
SHOULD-BE-DWIMIFIED? 69257 . 69946) (COMPEM 69948 . 70672) (GETCFILE 70674 . 72405) (SPECVARS 72407 .
72962) (LOCALVARS 72964 . 73538) (GLOBALVARS 73540 . 73742)) (76094 77043 (COMPILEMODE 76104 . 77041))
)))
STOP