Hacker News new | ask | show | jobs
by nercht12 2082 days ago
Actually, 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.

1 comments

That'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.