HCoop
/
jackhill
/
mal.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
bbc-basic: Minimal step 1.
[jackhill/mal.git]
/
bbc-basic
/
step1_read_print.bbc
1
REM Step 1 of mal in BBC BASIC
2
3
LIBRARY "malio_builtin"
4
LIBRARY "types"
5
LIBRARY "reader"
6
LIBRARY "printer"
7
8
PROCmalio_init
9
PROCtypes_init
10
11
REPEAT
12
line$ = FNmalio_input("user> ")
13
PROCmalio_println(FNrep(line$))
14
UNTIL FNmalio_eof
15
16
END
17
18
DEF FNREAD(a$)
19
=FNread_str(a$)
20
21
DEF FNEVAL(a%)
22
=a%
23
24
DEF FNPRINT(a%)
25
=FNpr_str(a%)
26
27
DEF FNrep(a$)
28
=FNPRINT(FNEVAL(FNREAD(a$)))