fmease / lushui

The reference compiler of the Lushui programming language
Apache License 2.0
7 stars 0 forks source link

Literals for Map-like types #56

Open fmease opened 3 years ago

fmease commented 3 years ago

Very likely we want to re-use "sequence literal" syntax instead of e.g. using new lexical syntax like {, } (curly braces might be used for structural records or as an alternative to indentation in the future).

Meta: Expand

Examples

Easiest to implement. Error-prone though. Not quite in favor.

@Hash-Map ["key0" value0 "key1" value1]

A bit more verbose. Less error-prone. However, a weird use of nested literals where the inner ones are not independent.

@Hash-Map [["key0" value0] ["key1" value1]]