Opened 4 years ago

#1295 new defect

Displaced arrays don't work as expected

Reported by: nhabedi Owned by:
Priority: normal Milestone:
Component: ANSI CL Compliance Version: 1.10
Keywords: Cc:

Description

The following code

(let* ((a (make-array '(5 5)))
       (b (make-array '(3 6)
                      :displaced-to a
                      :displaced-index-offset 4)))
  (dotimes (i 5)
    (dotimes (j 5)
      (setf (aref a i j) (+ (* 10 (1+ i)) (1+ j)))))
  (print (list (aref a 3 1) (aref b 2 0)))
  (setf (aref b 2 0) 23)
  (aref a 3 1))

prints (42 42) and returns 23 on LispWorks?, SBCL, AllegroCL, and CLISP. ClozureCL prints (42 33) and returns 42. Looks like it doesn't observe the offset.

Change History (0)

Note: See TracTickets for help on using tickets.