Please sign in to comment.
Add a workaround for a read-suppress bug in PJB's reader.
- Loading branch information...
Showing with 21 additions and 1 deletion.
|@@ -0,0 +1,19 @@|
|+;;; The code in this file is a modified copy of PJB's reader,|
|+;;; which is licensed under AGPL3; whatever this means.|
|+;;; Work around rational in base inside a disabled feature,|
|+;;; such as #+xxx #o0|
|+(defun read-rational-in-base (stream arg sub-char *read-base*)|
|+DO: Read a rational number in the base specified.|
|+RETURN: The rational read.|
|+ (when arg (serror 'simple-reader-error stream "no number allowed between # and ~A" sub-char))|
|+ (let ((value (let ((*read-suppress* nil)) (read stream t nil t))))|
|+ (if (rationalp value)|
|+ (serror 'simple-reader-error stream|
|+ "token \"~A\" after #~A is not a rational number in base ~D"|
|+ value sub-char *read-base*))))|