Handbook
Glossary
command-loop
Vocabulary
command-loop
Definition
IN:
command-loop
TUPLE:
command-loop
intro prompt commands abbrevs
;
Methods
USING:
accessors
assocs
combinators
command-loop
kernel
sequences
;
M:
command-loop
add-command
{
[
commands>>
push
]
[
[
[
name>>
]
keep
]
dip
[
abbrevs>>
]
bi@
[
set-at
]
curry
with
each
]
}
2cleave
;
USING:
accessors
assocs
command-loop
kernel
sequences
;
M:
command-loop
find-command
[
abbrevs>>
?at
drop
]
[
commands>>
[
name>>
=
]
with
find
nip
]
bi
;
USING:
accessors
ascii
combinators
command-loop
io
kernel
splitting
;
M:
command-loop
handle-command
swap
" "
split1
swap
>lower
[
pick
find-command
]
1check
[
nip
quot>>
( args -- )
call-effect
drop
]
[
rot
missing-command
]
if*
flush
;
USING:
command-loop
io
kernel
sequences
;
M:
command-loop
missing-command
drop
"ERROR: Unknown command '"
"'"
surround
print
drop
;
USING:
accessors
command-loop
command-loop.private
io
kernel
;
M:
command-loop
run-command-loop
dup
intro>>
[
print
]
when*
[
dup
prompt>>
[
write
bl
flush
]
when*
readln
[
over
?handle-command
t
]
[
f
]
if*
]
loop
drop
;