-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
Hi guys, I am trying to run JSON parser (yason:parse) with flexi-streams:in-memory-stream directly, because (yason:parse) can accept string steam input directly.
Then SBCL gives me the error when I did it. After checking the code of yason::parse and the error message, I found there are two generic functions of SBCL that needed to be implemented: SB-GRAY:STREAM-READ-CHAR and SB-GRAY:STREAM-PEEK-CHAR
So I tried to implement by code:
(defmethod SB-GRAY:STREAM-READ-CHAR ((s flexi-streams:in-memory-stream))
(code-char (read-byte s)))
(defmethod SB-GRAY:STREAM-PEEK-CHAR ((s flexi-streams:in-memory-stream))
(let ((char (code-char (flexi-streams:peek-byte s))))
char))Then yason:parse works fine with flexi-streams:in-memory-stream (at least now).
Do you guys trying to implement peek-char for flexi-streams:in-memory-stream? My code just work, I am not sure I met all hidden details of flexi-streams:in-memory-stream. It would be nice if flexi-stream has peek-char natively.
Thanks
Metadata
Metadata
Assignees
Labels
No labels