3 ms·
In natural language, "A isGreaterThan B" is a statement and reads as an assertion or a constraint, instead of a conditional test or question; it's ambiguous whe
by jodrellblank 7y ago
In natural language, "A isGreaterThan B" is a statement and reads as an assertion or a constraint, instead of a conditional test or question; it's ambiguous whether it should do anything. Esperanto has a flexible word order; I think the options would be:
ĉu A estas pli granda ol B? (S-V-O) (lit. "whether A is more big than B?")
ĉu A pli granda ol B estas? (S-O-V)
ĉu estas A pli granda ol B? (V-O-S)
and never "estas pli granda ol A B" as you suggest, but also never avoiding any indication that it's a question.
From a natural language side, it feels very contrived and arbitrary to have one hill measure whether it is bigger than another hill, instead of having an observer measure both 'from the outside'. That suggests the imbalance in syntax between a. and (b) is strange. a > b is more balanced and looks more like an outsider doing the comparison.
- thaumasiotes 7y ago> In natural language, "A isGreaterThan B" is a statement and reads as an assertion or a constraint, instead of a conditional test or question; it's ambiguous whether it should do anything. The reason functions with these names (and comparator operators) return booleans is precisely to make the code read like natural language. Look at the C syntax: if ( a > b ) { doSomething(); } We read this is "if a is greater than b, do something", and by an amazing coincidence, that's what the code does. In order to get the code to do what it says it will do, we need the > operator to be a conditional test. It always looks like a conditional test because it always appears in the explicit context of a conditional test. The fact that "a > b" outside of a conditional context looks like a constraint rather than a test isn't really relevant, because placing it outside of that context in the code is a no-op and therefore doesn't come up.