]> gitweb.factorcode.org Git - factor.git/commitdiff
persistent.hashtables: fix missing keys/values, not sure why these aren't assocs.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 7 Apr 2013 16:45:10 +0000 (09:45 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 7 Apr 2013 16:45:10 +0000 (09:45 -0700)
basis/persistent/hashtables/hashtables.factor

index 0159cab593c825bebc6b41ab576c40fab479b010..64577f8ff01411f1f5487aa902bcb2f12708e691 100644 (file)
@@ -1,7 +1,7 @@
 ! Based on Clojure's PersistentHashMap by Rich Hickey.
 
 USING: kernel math accessors assocs fry combinators parser
-prettyprint.custom locals make
+prettyprint.custom locals make sequences
 persistent.assocs
 persistent.hashtables.nodes
 persistent.hashtables.nodes.empty
@@ -39,6 +39,10 @@ M: persistent-hash pluck-at
 
 M: persistent-hash >alist [ root>> >alist% ] { } make ;
 
+M: persistent-hash keys >alist [ first ] map ;
+
+M: persistent-hash values >alist [ second ] map ;
+
 :: >persistent-hash ( assoc -- phash )
     T{ persistent-hash } assoc [| ph k v | v k ph new-at ] assoc-each ;