Handbook
Glossary
parse-wind ( str -- str' )
Vocabulary
metar
.
private
Inputs
str
an
object
Outputs
str'
an
object
Definition
USING:
combinators
formatting
kernel
sequences
splitting
;
IN:
metar.private
:
parse-wind
( str -- str' )
dup
"00000"
head?
[
drop
"calm"
]
[
"/"
split1
[
3
cut
]
unless*
[
parse-direction
]
dip
{
{
[
"KT"
?tail
]
[
"knots"
]
}
{
[
"MPS"
?tail
]
[
"meters per second"
]
}
[
"knots"
]
}
cond
[
"G"
split1
]
dip
[
parse-speed
]
curry
bi@
[
"%s at %s with gusts to %s "
sprintf
]
[
"%s at %s"
sprintf
]
if*
]
if
;