Ticket #1061 (closed defect: fixed)

Opened 18 months ago

Last modified 18 months ago

Multidimensional array reader syntax

Reported by: bayerf Owned by:
Priority: normal Milestone:
Component: ANSI CL Compliance Version: trunk
Keywords: Cc: fred@…

Description

The reader signals an error when the first sequence in the initial contents list isn't a list, but a vector, bitvector or string when parsing a 2-dimensional array literal:

? #2a("ab" #*01)

Error: Reader error on #<CCL::RECORDING-CHARACTER-INPUT-STREAM #x2100CE960D>,

near position 14:

Initial contents for #A is inconsistent with dimensions: #2A("ab" #<SIMPLE-BIT-VECTOR 2>)

While executing: CCL::SIGNAL-READER-ERROR, in process listener(1).

If the first sequence is a list, everything works fine:

? #2a((1 2) "ab" #*10) #2A((1 2) (#\a #\b) (1 0))

Creating the array with make-array also works fine:

? (make-array '(2 2) :initial-contents '("ab" #*10)) #2A((#\a #\b) (1 0))

Change History

comment:1 Changed 18 months ago by gb

  • Status changed from new to closed
  • Resolution set to duplicate

This is a duplicate of ticket:827.

comment:2 Changed 18 months ago by gb

  • Status changed from closed to reopened
  • Resolution duplicate deleted

comment:3 Changed 18 months ago by gb

Actually, it isn't (as revealed by actually reading the ticket ...)

comment:4 Changed 18 months ago by gb

  • Status changed from reopened to closed
  • Resolution set to fixed

(In [15734]) #nA - when n>0 - was expecting to be followed by either a list of lists or a vector of vectors (for some reason lost in antiquity). It should expect a sequence of sequences.

Fixes ticket:1061 in the trunk. Note that ticket:827 was actually describing the same problem but the discussion there largely focused on other things.

comment:5 Changed 18 months ago by bayerf

  • Cc fred@… added
  • Status changed from closed to reopened
  • Resolution fixed deleted

Still doesn't work in [15770]:

pi@xxxx ~/ccl $ ./armcl Welcome to Clozure Common Lisp Version 1.10-dev-r15770M-trunk (LinuxARM32)! ? #2a("ab" #*01)

Error: The value "ab" is not of the expected type (OR LIST (VECTOR T)). While executing: CCL::|#A-reader|, in process listener(1). Type :POP to abort, :R for a list of available restarts. Type :? for other options.

1 > :a

? #2a(#*0101 #*1010)

Error: The value #<SIMPLE-BIT-VECTOR 4> is not of the expected type (OR LIST (VECTOR T)). While executing: CCL::|#A-reader|, in process listener(1). Type :POP to abort, :R for a list of available restarts. Type :? for other options.

1 > :a

? #2a(#(1 0) #(0 1)) #2A((1 0) (0 1))

The last example now works, in contrast to my original bug report. And we have a different error message now in the (incorrectly) rejected inputs.

comment:6 Changed 18 months ago by gb

  • Status changed from reopened to closed
  • Resolution set to fixed

(In [15771]) Not sure if there's a way to wait longer to inconvenience/irritate the reporter more, but fix ticket:1061 (more accurately, fix a different bug introduced in a previous fix.)

Note: See TracTickets for help on using tickets.