From 8f9bb60471ec50b98b3f04748e31d849e5822661 Mon Sep 17 00:00:00 2001 From: Marek Kochanowicz Date: Tue, 10 May 2022 22:54:12 +0200 Subject: [PATCH] Added from-string that can handle unsigned/signed bytes. --- src/implementation.lisp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/implementation.lisp b/src/implementation.lisp index 11a1a71..59dec17 100644 --- a/src/implementation.lisp +++ b/src/implementation.lisp @@ -126,6 +126,14 @@ (subseq string start end)) +(defmethod from-string (type string start end) + (if (or (subtypep type 'unsigned-byte) (subtypep type 'signed-byte)) + (parse-integer string + :start start + :end end) + (call-next-method))) + + (defmethod to-string (type value) (princ-to-string value))