Download 4 - Forth Interest Group

Transcript
CHAR] ( replace-last-char
Keep-Spaces ON ENDOF
[ CHAR] 1 OF [ CHAR] 1 replace-last-char
Keep-Spaces OFF ENDOF
[CHAR] * OF DUP
ANDIF DUP 1- CHARS Formula
IF 1- [ CHAR] " ELSE
replace-last-char 1+
ENDOF
replace-last-char I t
0 ENDCASE
[
CHAR]
(
OF
1+
[
1+
+
[
C@ [ CHAR] * = THEN
CHAR] * THEN
3 5 3 : Get-Formula
( "multi-lines<colon>" -- addr len )
354
Keep-Spaces OFF
355
Formula 0
( str length)
35 6
BEGIN GET-CHAR DUP O< ABORT" End of File "
( length char)
35 7
@UP [ CHAR] : = NOT
358
WHILE DUP BL > ORIF DUP BL = Keep-Spaces @ AND THEN IF
359
accept-char-for-formula
360
ELSE DROP
3 61
THEN
( str length)
3 62
REPEAT DROP
363 ;
3 6 5 ( 'LET'
Translate 'varname=expr' or 'expr'. )
366 : LET
( "ccc<colon>" -- ) ( F: -- nothing or values )
367
Get-Formula translate-formula
368 ; IMMEDIATE
370
371
372
373
(
--
Wil Baden
Costa Mesa, California
)
Support for older systems
Hands-on hardware and software
Computing on the Small Scale
Since 1983
Subscriptions
1 year $24 - 2 years $44
All Back Issues available.
TCJ
The Computer Journal
P.O. Box 3900
Citrus Heights, CA 95611-3900
800-424-8825 / 916-722-4970
Fax: 916-722-7480
BBS: 916-722-5799
Forth Dimensions XIX.4
21