Opened 6 years ago

Last modified 18 months ago

#460 new defect

upgraded-array-element-type/class-of for arrays

Reported by: Mark Evenson Owned by:
Priority: critical Milestone: 1.9.3
Component: interpreter Version: 1.6.0-dev
Keywords: Cc:
Parent Tickets:

Description

Alan notes in <https://github.com/armedbear/abcl/issues/84>

No code of mine depends on this, but I was reading an article and it prompted me to check types of arrays and how upgraded-array-element-type works.

Bottom line is that it isn't consistent.

CL-USER> (make-array 1 :element-type '(unsigned-byte 16))
#(0)
CL-USER> (jobject-class *)
#<java class org.armedbear.lisp.BasicVector_UnsignedByte16 {6F28B4E2}>
CL-USER> (class-of (make-array 1 :element-type '(unsigned-byte 16)))
#<built-in-class vector {352D86C9}>
CL-USER> (upgraded-array-element-type '(unsigned-byte 16))
(unsigned-byte 16)
CL-USER> (make-array 1 :element-type '(unsigned-byte 17))
#(0)
CL-USER> (jobject-class *)
#<java class org.armedbear.lisp.BasicVector_UnsignedByte32 {1C49E33C}>
CL-USER> (upgraded-array-element-type '(unsigned-byte 17))
t
CL-USER> (class-of (make-array 1 :element-type '(unsigned-byte 17)))
#<built-in-class vector {352D86C9}>

Summary:

    Implementation of arrays of unsigned byte 16 vs 17 are different
    class-of reports the same type
    upgraded-array-element-type of (unsigned-byte 17) reports t, but it is in fact (unsigned-byte 32)
    trying to set array element of (unsigned-byte 17) to int larger than 2^17 works, but not setting to a symbol, as type t would imply

Change History (12)

comment:1 Changed 5 years ago by Mark Evenson

Milestone: 1.5.11.6.0
Priority: majorcritical

comment:2 Changed 5 years ago by Mark Evenson

Milestone: 1.6.01.6.1

Ticket retargeted after milestone closed

comment:3 Changed 5 years ago by Mark Evenson

Milestone: 1.6.11.6.2

Ticket retargeted after milestone closed

comment:4 Changed 5 years ago by Mark Evenson

Milestone: 1.6.21.7.0

comment:5 Changed 5 years ago by Mark Evenson

Milestone: 1.7.01.7.1

Ticket retargeted after milestone closed

comment:6 Changed 4 years ago by Mark Evenson

Milestone: 1.7.11.7.2

Ticket retargeted after milestone closed

comment:7 Changed 4 years ago by Mark Evenson

Milestone: 1.7.21.8.0

Milestone renamed

comment:8 Changed 4 years ago by Mark Evenson

Milestone: 1.8.01.8.1

Ticket retargeted after milestone closed

comment:9 Changed 3 years ago by Mark Evenson

Milestone: 1.8.11.9.0

comment:10 Changed 23 months ago by Mark Evenson

Milestone: 1.9.01.9.1

comment:11 Changed 22 months ago by Mark Evenson

Milestone: 1.9.11.9.2

comment:12 Changed 18 months ago by Mark Evenson

Milestone: 1.9.21.9.3
Note: See TracTickets for help on using tickets.