readln: rename (c<) to (rdln<)

so that it isn't picked up automatically at boot. Only when (c<$) is
called do we override (c<). This fixes tricky boot problems.
This commit is contained in:
Virgil Dupras 2020-04-12 14:01:54 -04:00
parent d6c9ab3f32
commit 420836276d
1 changed files with 14 additions and 12 deletions

View File

@ -19,17 +19,6 @@
( set IN> to IN( and set IN> @ to null ) ( set IN> to IN( and set IN> @ to null )
: (infl) 0 IN( @ DUP IN> ! ! ; : (infl) 0 IN( @ DUP IN> ! ! ;
( Initializes the readln subsystem )
: (c<$)
H@ IN( !
INBUFSZ ALLOT
H@ IN) !
( We need two extra bytes. 1 for the last typed 0x0a and
one for the following NULL. )
2 ALLOT
(infl)
;
( handle backspace: go back one char in IN>, if possible, then ( handle backspace: go back one char in IN>, if possible, then
emit SPC + BS ) emit SPC + BS )
: (inbs) : (inbs)
@ -73,10 +62,23 @@
; ;
( And finally, implement a replacement for the (c<) routine ) ( And finally, implement a replacement for the (c<) routine )
: (c<) : (rdln<)
IN> @ C@ ( c ) IN> @ C@ ( c )
( not EOL? good, inc and return ) ( not EOL? good, inc and return )
DUP IF 1 IN> +! EXIT THEN ( c ) DUP IF 1 IN> +! EXIT THEN ( c )
( EOL ? readline. we still return typed char though ) ( EOL ? readline. we still return typed char though )
(rdln) ( c ) (rdln) ( c )
; ;
( Initializes the readln subsystem )
: (c<$)
H@ IN( !
INBUFSZ ALLOT
H@ IN) !
( We need two extra bytes. 1 for the last typed 0x0a and
one for the following NULL. )
2 ALLOT
(infl)
['] (rdln<) 0x0c RAM+ !
;