* fixed bugs 280 and 312: the checking for multiple definitions in a
file is less likely to become confused by uses of inline
functions.
+ * fixed bug: the #S reader macro performs the keyword coercion
+ specified for slot names. (reported by Kalle Niemitalo)
* optimization: rearranged the expansion of various defining macros
so that each expands into only one top-level form in a
:LOAD-TOPLEVEL context; this appears to decrease fasl sizes by
(%reader-error
stream "The ~S structure does not have a default constructor."
(car body)))
- (apply (fdefinition def-con) (rest body))))))
+ (when (and (atom (rest body))
+ (not (null (rest body))))
+ (%reader-error
+ stream "improper list for #S: ~S." body))
+ (apply (fdefinition def-con)
+ (loop for tail on (rest body) by #'cddr
+ with slot-name = (and (consp tail) (car tail))
+ do (progn
+ (when (null (cdr tail))
+ (%reader-error
+ stream
+ "the arglist for the ~S constructor in #S ~
+ has an odd length: ~S."
+ (car body) (rest body)))
+ (when (or (atom (cdr tail))
+ (and (atom (cddr tail))
+ (not (null (cddr tail)))))
+ (%reader-error
+ stream
+ "the arglist for the ~S constructor in #S ~
+ is improper: ~S."
+ (car body) (rest body)))
+ (when (not (typep (car tail) 'string-designator))
+ (%reader-error
+ stream
+ "a slot name in #S is not a string ~
+ designator: ~S."
+ slot-name))
+ (when (not (keywordp slot-name))
+ (style-warn "in #S ~S, the use of non-keywords ~
+ as slot specifiers is deprecated: ~S."
+ (car body) slot-name)))
+ collect (intern (string (car tail)) *keyword-package*)
+ collect (cadr tail)))))))
\f
;;;; reading numbers: the #B, #C, #O, #R, and #X readmacros
;;; CSR managed to break the #S reader macro in the process of merging
;;; SB-PCL:CLASS and CL:CLASS -- make sure it works
(defstruct readable-struct a)
-(assert (eq (readable-struct-a
- (read-from-string "#S(READABLE-STRUCT :A T)"))
- t))
+(macrolet
+ ((frob (string)
+ `(assert (eq (readable-struct-a (read-from-string ,string)) t))))
+ (frob "#S(READABLE-STRUCT :A T)")
+ (frob "#S(READABLE-STRUCT A T)")
+ (frob "#S(READABLE-STRUCT \"A\" T)")
+ (frob "#S(READABLE-STRUCT #\\A T)")
+ (frob "#S(READABLE-STRUCT #\\A T :A NIL)"))
+(macrolet
+ ((frob (string)
+ `(assert (raises-error? (read-from-string ,string) reader-error))))
+ (frob "#S(READABLE-STRUCT . :A)")
+ (frob "#S(READABLE-STRUCT :A . T)")
+ (frob "#S(READABLE-STRUCT :A T . :A)")
+ (frob "#S(READABLE-STRUCT :A T :A . T)"))
;;; reported by Henrik Motakef
(defpackage "")
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.8.10.48"
+"0.8.10.49"