From 438380261a6d7fa8dcaa2ace178ad67507ba96c2 Mon Sep 17 00:00:00 2001 From: pfdietz <pfdietz@localhost> Date: Sat, 2 Oct 2004 12:12:48 +0000 Subject: [PATCH] Added note for result-type assumption (prompted by discussion with Haible); fixed some test warnings. --- ansi-tests/concatenate.lsp | 1 + ansi-tests/make-sequence.lsp | 1 + ansi-tests/map.lsp | 5 +++-- ansi-tests/notes.lsp | 13 +++++++++++-- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ansi-tests/concatenate.lsp b/ansi-tests/concatenate.lsp index 2911e279..f9384490 100644 --- a/ansi-tests/concatenate.lsp +++ b/ansi-tests/concatenate.lsp @@ -312,6 +312,7 @@ t) (deftest concatenate.error.6 + :notes (:result-type-element-type-by-subtype) (let ((type '(or (vector bit) (vector t)))) (if (subtypep type 'vector) (eval `(signals-error-always (concatenate ',type '(0 1 0) '(1 1 0)) error)) diff --git a/ansi-tests/make-sequence.lsp b/ansi-tests/make-sequence.lsp index a1cc952f..5086099e 100644 --- a/ansi-tests/make-sequence.lsp +++ b/ansi-tests/make-sequence.lsp @@ -470,6 +470,7 @@ t t) (deftest make-sequence.error.15 + :notes (:result-type-element-type-by-subtype) (if (subtypep '(or (vector bit) (vector t)) 'vector) (signals-error (make-sequence '(or (vector bit) (vector t)) 10 :initial-element 0) type-error) t) diff --git a/ansi-tests/map.lsp b/ansi-tests/map.lsp index f0ecd4f9..bf202846 100644 --- a/ansi-tests/map.lsp +++ b/ansi-tests/map.lsp @@ -254,6 +254,7 @@ t) (deftest map.error.10 + :notes (:result-type-element-type-by-subtype) (let ((type '(or (vector bit) (vector t)))) (if (subtypep type 'vector) (eval `(signals-error-always (map ',type #'identity '(1 0 1)) error)) @@ -384,7 +385,7 @@ for result = (map `(vector ,type) #'identity vals) unless (and (= (length result) len) (every #'eql vals result)) - collect (list i vals result)) + collect (list type vals result)) nil) (deftest map.specialized-vector.7 @@ -397,7 +398,7 @@ for result = (map `(vector ,type) #'identity vals) unless (and (= (length result) len) (every #'eql vals result)) - collect (list i vals result)) + collect (list type vals result)) nil) ;;; Order of evaluation tests diff --git a/ansi-tests/notes.lsp b/ansi-tests/notes.lsp index 9dfa70c3..72a1180f 100644 --- a/ansi-tests/notes.lsp +++ b/ansi-tests/notes.lsp @@ -18,7 +18,8 @@ "The standardized package nicknames specified in section 11 of ANSI CL are exclusive (disputed).") (defnote :type-of/strict-builtins - "Interpret requirement 1.a on the TYPE-OF page to apply to all built-in types that contain the object, not just to some builtin type that contains the object.") + "Interpret requirement 1.a on the TYPE-OF page to apply to all built-in types that +contain the object, not just to some builtin type that contains the object.") (defnote :assume-no-gray-streams "Disable the test if gray streams are present.") @@ -32,4 +33,12 @@ #+sbcl (rt::disable-note :open-if-exists-new-version-no-error) (defnote :negative-zero-is-similar-to-positive-zero - "The definition of similarity implies that -0.0 and 0.0 are similar (for each float type.) If negative zeros are distinct this is probably not good, since it makes (defconstant x 0.0) be nonportable.") + "The definition of similarity implies that -0.0 and 0.0 are similar (for each float type.) +If negative zeros are distinct this is probably not good, since it makes (defconstant x 0.0) be nonportable.") + +(defnote :result-type-element-type-by-subtype + "Assume that (for sequence functions MAP, etc.) the element type of a vector result type + is defined to be the type X such that result-type is a subtype of (vector X).") + +;;; Haible disagrees with :result-type-element-type-by-subtype +#+clisp (rt::disable-note :result-type-element-type-by-subtype) -- GitLab