Handbook
Glossary
parse-deposit-depth ( str -- str' )
Vocabulary
metar
.
private
Inputs
str
an
object
Outputs
str'
an
object
Definition
USING:
combinators
formatting
kernel
math
math.parser
;
IN:
metar.private
:
parse-deposit-depth
( str -- str' )
{
{
[
dup
"//"
=
]
[
drop
"depth not reported"
]
}
{
[
dup
"00"
=
]
[
drop
"depth less than 1 mm"
]
}
{
[
dup
"91"
=
]
[
drop
"reserved depth code 91"
]
}
{
[
dup
"98"
=
]
[
drop
"depth 40 cm or more"
]
}
{
[
dup
"99"
=
]
[
drop
"runway non-operational; depth not reported"
]
}
[
string>number
dup
92
<
[
"depth %s mm"
sprintf
]
[
90
-
5
*
"depth %s cm"
sprintf
]
if
]
}
cond
;