4 ms·
> Why "gte(a: 100)"? Syntax matters to a degree, why diverge? Not sure what about it are you criticizing? Local variable access using :? No commas between pa
by kroltan 6y ago
> Why "gte(a: 100)"? Syntax matters to a degree, why diverge?
Not sure what about it are you criticizing?
Local variable access using :?
No commas between parameters?
Operators using function call syntax?
- tom_mellior 6y agoNot 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.
- throwaway_pdp09 6y agoNot criticising, asking. > Local variable access using :? / No commas between parameters? / Operators using function call syntax? Well, yes, yes and yes.
- kroltan 6y agoDidn't mean to imply, my bad. Commas and function-call operators is actually pretty common in Lisp-likes, though they usually still use the symbol instead of some shorthand or initialism, and the opening parens comes before the function name: (= (> 4 1) true) I'm not a fan of Copper's local variable syntax though, as the uncle comment by tom_mellior articulated, looks too much like association.