2 ms·
For what it's worth from the Peanut Gallery™, I find the proposed syntax quite readable and am happy there are no angle brackets <> stabbing my eyes. It seems
by arghblarg 6y ago
For what it's worth from the Peanut Gallery™, I find the proposed syntax quite readable and am happy there are no angle brackets <> stabbing my eyes.
It seems powerful enough to cover most cases of generics. Architecture astronauts will never be happy, but tough.
- tapirl 6y agoComparing it with the builtin hashtable: * the custom one: hashtable.Table(string, int) * the builtin one: map[string]int The syntax forms are quite different. Wouldn't it be better to make them consistent? Is it so hard to achieve this?
- jeremyjh 6y agoIt would not surprise me to learn that the parser has special rules for the token "map".
- tapirl 6y agoYes, the fact that "map" is a keyword and "Table" is not really makes a trouble for parser. But I think we should think towards the road. There should be always a solution.
- mpfundstein 6y agolisp
- IshKebab 6y agoI'd definitely prefer angle brackets. With everything being parantheses I just get lost keeping track of what is what - they're now used for type parameters, parameters and return values, one after the other with no separation, and two of them are optional. Quite confusing if you ask me.
- Cthulhu_ 6y agoAnd yet, if you think about parsing it, they're all ways to group things together. Avoiding adding reserved characters (see also the discussion about adding ternaries) is a worthy goal to pursue. Keeps the parser(s) simpler too. An IDE / coloring scheme can help make things look more distinct if need be.