From 32f64a9a348d46a4fda4c963816ed2de459872ec Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Sun, 26 Apr 2020 08:01:21 -0500 Subject: header for file parse example --- examples/Tutorial.org | 80 ++++++++++++++++++++++++++------------------------- 1 file changed, 41 insertions(+), 39 deletions(-) diff --git a/examples/Tutorial.org b/examples/Tutorial.org index f82a872..235942d 100644 --- a/examples/Tutorial.org +++ b/examples/Tutorial.org @@ -752,45 +752,47 @@ PZ-JSON> #+END_SRC -Here is how you would parse somejson from a file: - -#+BEGIN_SRC lisp - -PZ-JSON> (with-open-file (file-input "examples/foo.json") - (let ((rp-stream (make-instance 'replay-streams:character-input-replay-stream - :source file-input))) - (parse rp-stream -PZ-JSON> - -#+END_SRC - -For the moment, parsers only work on instances of [[https://github.com/cbeo][replay-streams]]. If -you pass raw text to the =parse= function for its =STREAM= argument, -then you must also pass a =T= into its third optional argument -position. Otherwise the stream is assumed to be a =replay-stream=. +*** Parsing JSON Files + + Here is how you would parse some JSON from a file: + + #+BEGIN_SRC lisp + + PZ-JSON> (with-open-file (file-input "examples/foo.json") + (let ((rp-stream (make-instance 'replay-streams:character-input-replay-stream + :source file-input))) + (parse rp-stream + PZ-JSON> + + #+END_SRC + + For the moment, parsers only work on instances of [[https://github.com/cbeo][replay-streams]]. If + you pass raw text to the =parse= function for its =STREAM= argument, + then you must also pass a =T= into its third optional argument + position. Otherwise the stream is assumed to be a =replay-stream=. *** Problems to Puzzle Out -- cgit v1.2.3