2 ms·
Not the parent, but I personally don't like prefix syntax for such common operators. As for the colons combined with the absence of commas, this suggests keywor
by tom_mellior 6y ago
Not the parent, but I personally don't like prefix syntax for such common operators. As for the colons combined with the absence of commas, this suggests keyword syntax to me. I.e., as if the gte function took one argument named a. Like this Python call:
gte(a=100)
- deleted 6y ago[deleted]
- nercht12 6y agoActually, it can take multiple. gte(a: b: c: d:) is equivalent to (in C) a >= b && a >= c && a >= d. By making operators like functions, you can group like-operations and simplify code. Admittedly, it's not as readable for someone accustomed to seeing C style. Last note: gte(a=100) would produce an error in Copper because a=100 is an assignment statement that returns "a" (a function), and gte( function ) means nothing. Edit: I see you're referring to Python, but I figured I'd keep the note of comparison.
- kroltan 6y agoThat's... surprising, I could easily expect gte(a: b: c: d:) to possibly mean a >= b && b >= c && c >= d I think it's just not as readable precisely because of the ambiguity.