rebcabin / masr

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

Meanings of empty dimension and dimension*? #6

Open rebcabin opened 1 year ago

rebcabin commented 1 year ago

A dimension instance of (dimension ()) or (dimension []) is legal, according to the ASDL spec. What does it mean for a ttype instance like (Integer 4 [[]]) that enjoys this dimension instance (inside its dimension*, which has one dimension inside)?

Presumably, it means that the object enjoying the ttype is a naked Integer in this case, not a 1x1 array, not necessarily a scalar?

For that matter, please write about the distinctions between the following

(Integer 4 [])  ;; empty dimension* 
(Integer 4 [[]])  ;; singleton dimension* with one empty dimension [sic]
certik commented 1 year ago

See https://github.com/rebcabin/masr/issues/7#issuecomment-1512423745. The difference is that (Integer 4 []) is a scalar, while (Integer 4 [[]]) would be an array of rank 1 of size 0.

rebcabin commented 1 year ago

b5f1d83 fix issue 6

rebcabin commented 1 year ago

reopening as documentation reminder as requested by @certik