]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/usa-cities/usa-cities.factor
Temporary kludge can safely be removed
[factor.git] / extra / usa-cities / usa-cities.factor
index 111ea991592d9b2a16fca566b27ac8dbe2dab5b9..ff3d8801071a553459c32cac5987cb351b038008 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2008 Slava Pestov.
-! See http://factorcode.org/license.txt for BSD license.
-USING: io.files io.encodings.ascii sequences generalizations
-math.parser combinators kernel memoize csv summary
-words accessors math.order binary-search combinators.smart ;
+! See https://factorcode.org/license.txt for BSD license.
+USING: accessors binary-search combinators combinators.smart csv
+io.encodings.ascii kernel math.order math.parser sequences
+summary ;
 IN: usa-cities
 
 SINGLETONS: AK AL AR AS AZ CA CO CT DC DE FL GA HI IA ID IL IN
@@ -21,14 +21,14 @@ ERROR: no-such-state name ;
 M: no-such-state summary drop "No such state" ;
 
 MEMO: string>state ( string -- state )
-    dup states [ name>> = ] with find nip
-    [ ] [ no-such-state ] ?if ;
+    [ states [ name>> = ] with find nip ]
+    [ no-such-state ] ?unless ;
 
 TUPLE: city
 first-zip name state latitude longitude gmt-offset dst-offset ;
 
 MEMO: cities ( -- seq )
-    "resource:extra/usa-cities/zipcode.csv" ascii file>csv
+    "vocab:usa-cities/zipcode.csv" ascii file>csv
     rest-slice [
         [
             {