Skip to content

Rename #of to 'of, and perhaps rename #tuple #96

@qwertie

Description

@qwertie

List!Foo, or List<Foo> in C#, is translated to a Loyc tree like #of(List, Foo), but isn't this an operator? If it is an operator, it should use the operator marker which is an apostrophe, and it should probably be renamed to 'of.

Also, multi-argument generics like Map!(String, Object) or Map<String, Object> are currently stored as a single call like #of(Map, String, Object), but the parser would be a bit simpler if ! were treated more like a normal binary operator: 'of(Map, #tuple(String, Object).

And what about tuples? It seems to me that the tuple constructor is operator-like, so it should be marked with ' instead of #. But is 'tuple an appropriate name? I like avoiding English names where possible to make Loyc trees more international; it could be called '() instead, but this wouldn't communicate the distinction between (x;) and (x). Since semicolon and comma are used in different languages to separate tuple items, neither '(,) and '(;) is a uniquely good name either, especially since both of them kind of look like they might represent 1-tuples instead of N-tuples... so I'm leaning toward 'tuple.

Similarly, 'of could be renamed to use punctuation only, but different languages use different punctuation for genericity and while X<T> is the most popular syntax, it isn't used in LES. Any thoughts @jonathanvdc?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions