X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fsharpm.lisp;h=758114ffa198150f3b34ad6ad8aac053227649e5;hb=a6a12ed609d5467ec43b411283e5b3568fee81df;hp=a6288726f620adb8ef3c94ffb2705c19edd3fbca;hpb=88dab5bc2cb92077bced88729dc95096b3b6a127;p=sbcl.git diff --git a/src/code/sharpm.lisp b/src/code/sharpm.lisp index a628872..758114f 100644 --- a/src/code/sharpm.lisp +++ b/src/code/sharpm.lisp @@ -93,10 +93,15 @@ (when *read-suppress* (read stream t nil t) (return-from sharp-A nil)) - (unless dimensions (simple-reader-error stream - "no dimensions argument to #A")) + (unless dimensions + (simple-reader-error stream "No dimensions argument to #A.")) (collect ((dims)) - (let* ((contents (read stream t nil t)) + (let* ((*bq-error* + (if (zerop *backquote-count*) + *bq-error* + "Comma inside a backquoted array (not a list or general vector.)")) + (*backquote-count* 0) + (contents (read stream t nil t)) (seq contents)) (dotimes (axis dimensions (make-array (dims) :initial-contents contents)) @@ -122,8 +127,14 @@ (when *read-suppress* (read stream t nil t) (return-from sharp-S nil)) - (let ((body (if (char= (read-char stream t) #\( ) - (read-list stream nil) + (let* ((*bq-error* + (if (zerop *backquote-count*) + *bq-error* + "Comma inside backquoted structure (not a list or general vector.)")) + (*backquote-count* 0) + (body (if (char= (read-char stream t) #\( ) + (let ((*backquote-count* 0)) + (read-list stream nil)) (simple-reader-error stream "non-list following #S")))) (unless (listp body) (simple-reader-error stream "non-list following #S: ~S" body))