pallene-lang / pallene

Pallene Compiler
MIT License
687 stars 29 forks source link

Implement maps based on Lua tables #124

Open gligneul opened 4 years ago

gligneul commented 4 years ago

AKA associative array. The proposed syntax is {T1 -> T2}. Like arrays, indexing an entry that yields nil might result in a runtime type error.

hugomg commented 4 years ago

The proposed syntax is ambiguous with arrays of functions.

We could use {A=>B} instead. Or {A:B}, like Typed Lua

gligneul commented 4 years ago

Indeed. I would use {A=>B} to make clear it is not a table.

gligneul commented 4 years ago

Anyone who implement this could use the PR #139 as inspiration.