Syntax of records and arrays

37 views
Skip to first unread message

Yannick Duchêne

unread,
Jun 12, 2018, 9:58:43 PM6/12/18
to ats-lang-users
I just checked I can write this without an error, mixing numbers and names for record labels:

        @{0=int, a=char}

It this intended? I don’t want to comment on the choice, this is just to know if it’s intended.

With arrays, I noticed I can write this:

        @[char][] // No dimensions
        @[char][3, 2] // Multiple dimensions

For the first one, I don’t understand what it means, but it does not trigger any error and the JSON produced just contains no dimensions. Is this intended? The second is clear, but I wonder if it is intended too, since I did not find a confirmation in the introduction and tutorial PDF.

Hongwei Xi

unread,
Jun 13, 2018, 8:59:06 PM6/13/18
to ats-lan...@googlegroups.com

>>@{0=int, a=char}

This may look unorthodox, but it is supported.
A label in ATS2 can be either a number or an identifier.

>>@[char][]
>>@[char][3,2]

Yes, these types are legal at level-2. They may not be supported at
a later stage during compilation. My intention is to support arrays of multiple
dimension eventually.



--
You received this message because you are subscribed to the Google Groups "ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-users+unsubscribe@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/1e05ef48-35b9-4c1c-878a-4cf60966b753%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages