You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Format implementation functions set a known variable *BYTECOUNTER* (#402)
* Format implementation functions set a known variable *BYTECOUNTER*
The generic functions deal with updating the application variable.
\INCHAR eliminated in favor of \INCCODE.EOLC to make clear what it does.
OPENSTRINGSTREAM streams have their own format, and the string is always fattened.
READBITMAP doesn't mix character and byte reading
* AOFD: Don't execute \STRINGSTREAM.INIT
This creates a file device that is not used anywhere. The function OPENSTRINGSTREAM provides the functionality that this file device suggests that it would provide, but that functionality seems suspect at best. The function is left in the system for now, probably should be deleted at some point in the future so we don't try to maintain it if we trip over it.
* TTYIN: Fix an ancient coding error
but still doesn't solve the (DIRECTORY ?= problem #402
* LLREAD, FILEIO, XCCS: Improve charcode backing, copychars
Added \BACKCCODE.EOLC that backs up over EOL encoding bytes, simplifies \RSTRING2.
\XCCSBACKCCODE returns T/NIL according to whether it succeeded.
\XCCSOUTCHAR uses IPLUS16 for CHARPOSITION
COPYCHARS makes no assumptions about EOL encoding
But still no solution for #402
* LLREAD, TTYIN.LCOM fix#402
The bug showed up in TTYIN, but it was actually a bad edit in the generic backccode.
TTYIN.LCOM is just a recompile--that had never been done with various new declarations.
(* ;; "STREAM interface for old-style strings. However (RMK), it appears never to be used, and even commonlisp string-streams are created using the Interlisp OPENSTRINGSTREAM above. For now, keep the function, but don't execute it")
(* ;; "Does not register the stream on \OPENFILES, nor does it search \OPENFILES for a previously opened stream. Thus, this implementation does not side-effect the string as the 10 does. However, the temporary coercion of strings to open streams in \GETSTREAM does simulate the side-effecting. Note that a string stream is unnamed.")
538
-
539
-
(PROG (STREAM FATP)
540
-
(OR (STRINGP STR)
541
-
(\ILLEGAL.ARG STR))
542
-
(SETQ FATP (ffetch (STRINGP FATSTRINGP) of STR))
543
-
[SETQ STREAM (\MAKEBASEBYTESTREAM (OR (ffetch (STRINGP BASE) of STR)
544
-
T)
545
-
(COND
546
-
(FATP (UNFOLD (ffetch (STRINGP OFFST) of STR)
547
-
BYTESPERWORD))
548
-
(T (ffetch (STRINGP OFFST) of STR)))
549
-
(COND
550
-
(FATP (UNFOLD (ffetch (STRINGP LENGTH) of STR)
551
-
BYTESPERWORD))
552
-
(T (ffetch (STRINGP LENGTH) of STR)))
553
-
(SELECTQ ACCESS
554
-
((INPUT OUTPUT BOTH)
555
-
ACCESS)
556
-
(NIL 'INPUT)
557
-
(\ILLEGAL.ARG ACCESS]
558
-
(PROGN (* ;
559
-
"Minor differences between a basebytestream and a stringstream")
560
-
(if FATP
561
-
then (freplace (STREAM CHARSET) of STREAM with \NORUNCODE))
562
-
(freplace USERCLOSEABLE of STREAM with T)
563
-
(freplace USERVISIBLE of STREAM with T)
564
-
(SELECTQ (SYSTEMTYPE)
565
-
(VAX (freplace F2 of STREAM with 0)
566
-
(freplace STRMBINFN of STREAM with (FUNCTION \STRINGBIN)))
567
-
NIL))
568
-
(RETURN STREAM])
538
+
[LAMBDA (STR ACCESS) (* ; "Edited 8-Aug-2021 00:02 by rmk:")
539
+
(* rmk%: "28-Mar-85 08:40")
540
+
541
+
(* ;; "We fatten thin strings at the start so that the byte-level functions (bin, bout, getfileptr, setfrileptr) give the same (2-bytes per character) picture of the byte sequence even if we started out thin.")
542
+
543
+
(* ;; "Does not register the stream on \OPENFILES, nor does it search \OPENFILES for a previously opened stream. ")
544
+
545
+
(SELECTQ ACCESS
546
+
((INPUT OUTPUT BOTH))
547
+
(NIL (SETQ ACCESS 'INPUT))
548
+
(\ILLEGAL.ARG ACCESS))
549
+
(CL:UNLESS (STRINGP STR)
550
+
(\ILLEGAL.ARG STR))
551
+
(LET (STREAM)
552
+
(IF (AND (EQ ACCESS 'INPUT)
553
+
(NOT (ffetch (STRINGP FATSTRINGP) of STR)))
554
+
THEN (\FATTENSTRING STR)
555
+
ELSE (\SMASHABLESTRING STR T))
556
+
557
+
(* ;; "String storage is now fat")
558
+
559
+
(SETQ STREAM (\MAKEBASEBYTESTREAM (OR (ffetch (STRINGP BASE) of STR)
560
+
T)
561
+
(UNFOLD (ffetch (STRINGP OFFST) of STR)
562
+
BYTESPERWORD)
563
+
(UNFOLD (ffetch (STRINGP LENGTH) of STR)
564
+
BYTESPERWORD)
565
+
ACCESS))
566
+
567
+
(* ;; "Differences between a basebytestream and a stringstream")
568
+
569
+
(\EXTERNALFORMAT STREAM :STRING)
570
+
(freplace USERCLOSEABLE of STREAM with T)
571
+
(freplace USERVISIBLE of STREAM with T)
572
+
STREAM])
573
+
574
+
(MAKE-STRING-FORMAT
575
+
[LAMBDA NIL (* ; "Edited 8-Aug-2021 00:10 by rmk:")
576
+
577
+
(* ;; "We are looking at an in-core string, we know that EOL is CR, that the characters have the internal (XCCS) encoding, and that the string is fat. ")
"STREAM interface for old-style strings. However (RMK), it appears never to be used, and even commonlisp string-streams are created using the Interlisp OPENSTRINGSTREAM above. For now, keep the function, but don't execute it"
613
+
)
574
614
575
615
(DEFINEQ
576
616
577
617
(\STRINGSTREAM.INIT
578
-
[LAMBDA NIL (* bvm%: "14-Feb-85 00:25")
618
+
[LAMBDA NIL (* ; "Edited 9-Aug-2021 23:30 by rmk:")
619
+
620
+
(* ;; "RMK: This is described as creating a file device for %"old style%" strings. But the variable that it sets is never referenced. The common lisp functions that treat strings as streams all seem to go through OPENSTRINGSTREAM, which now has a proper external format.")
621
+
622
+
(* ;; "Moreover, it appears that the BIN function defined here, in terms of GNC, would have had the effect of updating the string pointer of the string as visible using ordinary string functions. ")
623
+
624
+
(* ;; "Finally, this appears to be read only. No BOUT is provided.")
625
+
626
+
(* ;; "")
627
+
628
+
(* ;; " In sum: this is a candidate for removal.")
0 commit comments