Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
qwertie opened this issue Nov 23, 2019 · 0 comments
Labels

Comments

@qwertie
Copy link
Owner

@qwertie qwertie commented Nov 23, 2019

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?

@qwertie qwertie added the proposal label Nov 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.