teal-language / tl

The compiler for Teal, a typed dialect of Lua
MIT License
2.15k stars 111 forks source link

Add support for tuplerecords #497

Open saecki opened 2 years ago

saecki commented 2 years ago

So there already are arrayrecords like:

record A
    {string}
    a: integer
end

It would be great if there could be tuplerecords like:

record A
    {string, string, integer}
    a: integer
end
hishamhm commented 2 years ago

That does sound like a good idea!...

lenscas commented 2 years ago

What about allowing this:

record A
    [1] string
 end

(or, maybe even without the [] part?)

hishamhm commented 2 years ago

If anyone is willing to try their hand at a PR, I'd rather have the syntax originally suggested by @Saecki , I think it'd be more consistent with the existing array records:

record A
    {string, string, integer}
    a: integer
end