Handbook
Glossary
parse-location ( str -- n )
Vocabulary
metar
.
private
Inputs
str
an
object
Outputs
n
an
object
Definition
USING:
combinators
kernel
math
math.parser
sequences
splitting
;
IN:
metar.private
:
parse-location
( str -- n )
"-"
split
dup
length
{
{
3
[
first3
[
string>number
]
tri@
60.0
/
+
60.0
/
+
]
}
{
2
[
first2
[
string>number
]
bi@
60.0
/
+
]
}
{
1
[
first
string>number
]
}
[
drop
bad-location
]
}
case
;