aboutsummaryrefslogtreecommitdiff
path: root/forth/step0_repl.fs
blob: 2483c12c8424dc72ce51e6bdcbf4ddf8dccde7df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require types.fs

: read ;
: eval ;
: print ;

: rep
    read
    eval
    print ;

create buff 128 allot

: read-lines
    begin
      ." user> "
      buff 128 stdin read-line throw
    while
      buff swap
      rep type cr
    repeat ;

read-lines