Handbook
Glossary
run-wc ( -- )
Vocabulary
tools
.
wc
Inputs
None
Outputs
None
Definition
USING:
command-line
io
io.files
kernel
math
namespaces
sequences
tools.wc.private
;
IN:
tools.wc
:
run-wc
( -- )
command-line
get
[
wc-stdin
f
print-wc
]
[
[
dup
file-exists?
[
[
wc
]
keep
dupd
print-wc
]
[
write
": not found"
print
flush
f
]
if
]
map
sift
dup
length
1
>
[
sum
"total"
print-wc
]
[
drop
]
if
]
if-empty
;