]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/metar/metar.factor
core: Add words/unwords/unwords-as and use them.
[factor.git] / extra / metar / metar.factor
index 1fc78adc4302c6edb75d488775187155faa066f4..cba09c6bd3d6693a159f6757248baccab6e8b9d9 100644 (file)
@@ -275,7 +275,7 @@ CONSTANT: compass-directions H{
             [ drop f ]
         } case [
             2 group dup [ weather key? ] all?
-            [ [ weather at ] map " " join ]
+            [ [ weather at ] map unwords ]
             [ concat parse-glossary ] if
         ] dip prepend
     ] if ;
@@ -488,7 +488,7 @@ CONSTANT: high-clouds H{
     [ [ f ] [ low-clouds at "low clouds are %s" sprintf ] if-zero ]
     [ [ f ] [ mid-clouds at "middle clouds are %s" sprintf ] if-zero ]
     [ [ f ] [ high-clouds at "high clouds are %s" sprintf ] if-zero ]
-    tri* 3array " " join ;
+    tri* 3array unwords ;
 
 : parse-inches ( str -- str' )
     dup [ CHAR: / = ] all? [ drop "unknown" ] [
@@ -524,7 +524,7 @@ CONSTANT: high-clouds H{
     "sea-level pressure is %s hPa" sprintf ;
 
 : parse-lightning ( str -- str' )
-    "LTG" ?head drop 2 group [ lightning at ] map " " join ;
+    "LTG" ?head drop 2 group [ lightning at ] map unwords ;
 
 CONSTANT: re-recent-weather R/ ((\w{2})?[BE]\d{2,4}((\w{2})?[BE]\d{2,4})?)+/
 
@@ -547,7 +547,7 @@ CONSTANT: re-recent-weather R/ ((\w{2})?[BE]\d{2,4}((\w{2})?[BE]\d{2,4})?)+/
 
 : parse-recent-weather ( str -- str' )
     split-recent-weather
-    [ (parse-recent-weather) ] map " " join ;
+    [ (parse-recent-weather) ] map unwords ;
 
 : parse-varying ( str -- str' )
     "V" split1 [ string>number ] bi@
@@ -604,7 +604,7 @@ CONSTANT: re-recent-weather R/ ((\w{2})?[BE]\d{2,4}((\w{2})?[BE]\d{2,4})?)+/
     } cond ;
 
 : metar-remarks ( report seq -- report )
-    [ parse-remark ] map " " join >>remarks ;
+    [ parse-remark ] map unwords >>remarks ;
 
 : <metar-report> ( metar -- report )
     [ metar-report new ] dip [ >>raw ] keep