Handbook
Glossary
parse-sea-condition ( str -- str' )
Vocabulary
metar
.
private
Inputs
str
an
object
Outputs
str'
an
object
Definition
USING:
assocs
formatting
kernel
math
math.parser
sequences
splitting
;
IN:
metar.private
::
parse-sea-condition
( str -- str' )
str
rest
:>
code code
"//"
head?
[
"//"
code 3
tail
]
[
code
"/"
split1
]
if
:>
( temperature condition ) temperature
parse-temperature-value
[
"unavailable"
]
unless*
condition
"S"
head?
[
condition
rest
sea-states
at
"sea state %s"
sprintf
]
[
condition
rest
dup
[
47
=
]
all?
[
drop
"wave height unavailable"
]
[
string>number
10
/f
"significant wave height %.1f meters"
sprintf
]
if
]
if
"sea-surface temperature %s; %s"
sprintf
;