json.reader: enforce json> takes a string.

db4
John Benediktsson 2015-07-28 18:02:57 -07:00
parent 8a731681bf
commit 922cbebf8a
1 changed files with 6 additions and 5 deletions

View File

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