[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Degenerate array axes -- really array printing.



    Date: Thu, 6 Jun 85 10:34 EDT
    From: Guy Steele <gls@THINK.ARPA>

    [...]

    Under option (3), how about
    	#A<dimension-list><initial-element>
    ?  This would provide a notation for empty arrays, as well as a concise
    notation for arrays with all elements the same (EQL).  For empty arrays
    the initial element doesn't especially matter, so use ().
    So one would have
    	(make-array '(0 5)) => #A(0 5)()
    	(make-array '(0 10)) => #A(0 10)()

    Of course, this is a non-trivial extension to the language.

It is also rather ugly, in that there seem to be no other predefined
reader macros which read TWO sexps as this does, and as such this may
be a little confusing.

I suppose the other way to do this is to print
`#.(make-array '(0 5) :initial-element 'foo)'

Speaking of which, it has always struck me as sort of a shame that
there is no convenient representation for arrays other than simple
bit-vectors, simple strings, and multidimensional arrays of
element-type `t'.

It would have been nice if there had been some facility for providing
`make-array' options by way of the `#a' macro construct (excluding
`:displaced-to' and `:displaced-index-offset') but as it is one must
print `#.(make-array ...)' in order to read in an `isomorphicp' array.

Any takers for
`#a((2 5) :element-type (mod 4) :fill-pointer 2 :initial-element 3)'?!!