Handbook
Glossary
decode-remarks ( seq -- str )
Vocabulary
metar
.
private
Inputs
seq
an
object
Outputs
str
an
object
Definition
USING:
formatting
kernel
math
sequences
splitting
;
IN:
metar.private
::
decode-remarks
( seq -- str )
V{
}
clone
:>
decoded 0
:>
i!
[
i seq
length
<
]
[
i seq
nth
:>
token i 1
+
seq
?nth
:>
value token
"WSHFT"
=
value
and
[
value
parse-recent-time
"wind shift at %s"
sprintf
decoded
push
i 2
+
i!
]
[
token
"CIG"
=
value
and
[
value
"V"
subseq-of?
[
value
parse-varying
]
[
value
parse-altitude
"ceiling"
prepend
]
if
decoded
push
i 2
+
i!
]
[
token
"SEAS"
=
value
and
[
value
parse-seas
decoded
push
i 2
+
i!
]
[
token
"SNINCR"
=
value
and
[
value
"/"
split1
"snow increased %s inches in the last hour; total depth %s inches"
sprintf
decoded
push
i 2
+
i!
]
[
token
"PK"
=
value
"WND"
=
and
i 2
+
seq
?nth
and
~quotation~ ~quotation~
if
]
if
]
if
]
if
]
if
]
while
decoded
join-words
;