4 ms·
Lots of languages use [] with colon separators for array slicing, e.g. F#, Perl, Ruby. The idea that this syntax involves "deep knowledge" is laughable. Your
by mquander 14y ago
Lots of languages use [] with colon separators for array slicing, e.g. F#, Perl, Ruby. The idea that this syntax involves "deep knowledge" is laughable.
Your criticism is analogous to me looking at "int* foo = bar()" and saying, hey, we're multiplying a type by a name! How ridiculous!
- Evbn 14y agoWell, that is ridiculous. It makes the language literally impossible to parts without context-sensive semantic analysis. Go Language fixes that bug by always having a type name first or a colon after introducing a variable.
- blub 14y agoThe int pointer syntax is in fact ridiculous, so it does not support your point. Also s[x:y] is intuitively understandable compared to referencing two colons and minus one...