First one may look at the first argument as a key name instead of a type.
For example in
local function name(arg1: type)
the first arg is a name and the second one is a type. But with tables this is not the case which is very ambigious and odd.
While distinct key name pairs are implemented by records in teal, it would be great if this wasn't as ambigious.
Hence, I propose an alternate syntax for maps which is
{[type]: type}
and deprecate the current syntax (although it should be kept for backwards compatibility purposes).
Having this inside square brackets would make it less ambigious to the reader to understand that the first argument is indeed a type argument not a key name.
https://github.com/teal-language/tl/blob/master/docs/tutorial.md#maps
Currently the syntax for maps is
this is a bit ambigious for a few reasons.
First one may look at the first argument as a key name instead of a type. For example in
the first arg is a name and the second one is a type. But with tables this is not the case which is very ambigious and odd.
While distinct key name pairs are implemented by records in teal, it would be great if this wasn't as ambigious.
Hence, I propose an alternate syntax for maps which is
and deprecate the current syntax (although it should be kept for backwards compatibility purposes).
Having this inside square brackets would make it less ambigious to the reader to understand that the first argument is indeed a type argument not a key name.