cogent icon indicating copy to clipboard operation
cogent copied to clipboard

new syntax: `type` defines multiple types

Open zilinc opened this issue 9 years ago • 7 comments

type A, B, C

zilinc avatar Dec 08 '16 03:12 zilinc

and also for abstract functions/constants:

const_1, const_2, const_3 : U16

zilinc avatar Dec 08 '16 03:12 zilinc

type A, B, C = U16 looks ambiguous, so we might not implement this feature, unless there're some good suggestions.

zilinc avatar Dec 08 '16 03:12 zilinc

Is this something to put in our syntactic sugar bucket?

liamoc avatar Dec 08 '16 03:12 liamoc

should be, indeed.

zilinc avatar Dec 08 '16 03:12 zilinc

we should be able to do something like type A = U16, B = U32, C = U64 even, I think.

ajaysusarla avatar Dec 08 '16 04:12 ajaysusarla

what about something like type A, B = U16 ? Is that equivalent to:

type A
type B = U16

or

type A = U16
type B = U16

or not permitted?

liamoc avatar Dec 08 '16 04:12 liamoc

originally I thought the latter.. just like typedef.. but as I realised the potential ambiguity I gave up...

zilinc avatar Dec 08 '16 04:12 zilinc