]> gitweb.factorcode.org Git - factor.git/commitdiff
json.reader: enforce json> takes a string.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 29 Jul 2015 01:02:57 +0000 (18:02 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 29 Jul 2015 01:02:57 +0000 (18:02 -0700)
basis/json/reader/reader.factor

index f46226531a4bfd8119aa05080d6fd1817bbc5ba0..8028b507c8612de092a90fd76ebca1e800e2e616 100644 (file)
@@ -1,10 +1,9 @@
 ! Copyright (C) 2008 Peter Burns, 2009 Philipp Winkler
 ! See http://factorcode.org/license.txt for BSD license.
 
-USING: arrays assocs combinators fry hashtables io
-io.streams.string json kernel kernel.private math math.parser
-namespaces sbufs sequences sequences.private strings vectors
-math.order ;
+USING: assocs combinators fry io io.streams.string json kernel
+kernel.private math math.order math.parser namespaces sbufs
+sequences sequences.private strings vectors ;
 
 IN: json.reader
 
@@ -131,5 +130,7 @@ PRIVATE>
 : read-jsons ( -- objects )
     input-stream get stream-json-read ;
 
-: json> ( string -- object )
+GENERIC: json> ( string -- object )
+
+M: string json>
     [ read-jsons first ] with-string-reader ;