Open guicho271828 opened 5 years ago
SBCL has similar syntax but the array dimensions and type are switched, and the array values are consed on to the end:
* (setf *print-readably* t)
T
* (make-array '(2 2) :element-type '(signed-byte 8) :initial-element '0)
#A((2 2) (SIGNED-BYTE 8) (0 0) (0 0))
hmm, which sbcl version are you using? I can't reproduce the behavior
I now see, it should be printed, not on the repl.
Personally I feel it is saner to have a form
#A((2 2) :element-type (signed-byte 8) :initial-contents ((0 0) (0 0)))
because it preserves the duality between the constructor and the reader.
The same goes with the structure literals:
#S(point2d :x 0 :y 0)
reflects the constructor function call (point2d :x 0 :y 0)
.
Allegro Common Lisp extends #A
reader macro for similar purpose, but its syntax is very different from the one discussed here.
See https://franz.com/support/documentation/10.1/doc/implementation.htm#sharpsign-a-2
#A((SIGNED-BYTE 8) (2 2) ((0 0) (0 0)))