5 ms·
Chinese also has an interesting sentence structure that doesn't quite fit with European languages. In addition to subject.verb(object) form, there is also a ki
by brandmeyer 6y ago
Chinese also has an interesting sentence structure that doesn't quite fit with European languages. In addition to subject.verb(object) form, there is also a kind of topic-comment form that might be reasonable to use in some assertion-like contexts.
ensure(foo), !empty()
require(bar), open()
Chinese also has a word that can transform some kinds of statements into a question. `ma` is used to form yes-no questions. Imagine if languages with truthy values required you to use an explicit keyword/character in postfix position to take a non-boolean value and use it in boolean context.
if predicate:
pass
if non_predicate ma:
pass
To be clear, I'm not actually advocating for such constructs. The topic-comment form breaks down as soon as you want a predicate on multiple objects. The automatic truthy values concept is already falling out of favor in preference for explicit predicates like file_handle.is_open(). I don't actually want to program in "Cobol, but Chinese". But it is interesting to explore the space.
- henrikeh 6y agoBulgarian also has a question particle (li or ли). In many cases questions are phrased by simply inserting “li” next to the focus of the question.
- Tyr42 6y agoIf you want to go further, it sometimes feels like the "who what where" pronouns are like sql prepared statements. In English, we have question and answer Q: Where do you want to go for lunch? A: I want to go to that pub for lunch. In Chinese you'd say Q: You want to go to ?? pub for lunch? A: I want to go to that pub for lunch. It even works for numbers, like Q: It is ?? o'clock? A: It is 7 o'clock.