rebcabin / masr

Meta ASR: replacement for aging ASDL
MIT License
4 stars 0 forks source link

Dimensions of length 0? #7

Open rebcabin opened 1 year ago

rebcabin commented 1 year ago

The following are legal dimensions in the ASDL grammar, written in as an array of dimensions sic in context of an Integer ttype for convenience:

(Integer 4 [[0]])  ;; array of length 0? pointer?
(Integer 4 [[6 0]])  ;; array of length 0 with starting index = 6? meaning?

Is an array of length 0 a naked integer? Or a typed pointer with value nil? Or something else?

certik commented 1 year ago

We have not tackled this yet. In Fortran you can have dimension of length 0 (not sure how you index into it though), or possibly only the total size can be 0. It's a corner case.