On 2022-01-19 00:02, Steven D'Aprano wrote:
On Wed, Jan 19, 2022 at 10:12:23AM +1100, Chris Angelico wrote:
Not sure about Python, but C and C++ have digraphs and trigraphs as alternatives for certain symbols, specifically because some OS/keyboard/language combinations may not be able to easily type the originals.
I believe that those C digraphs date back to days when ASCII was not a guaranteed lowest common denominator, and there were computers that did not support characters such as braces {}. And then C++ just inherited them from C.
Pascal had the same thing: comments were either {comment} or (*comment*) specifically because in the 1970s there were lots of computers and OSes that did not support braces. It wasn't until the early 80s that the ASCII character set became more or less universally supported in the English-speaking world.
Okay. Without looking it up, how would *you* type ⟮ U+27EE "Mathematical Left Flattened Parentheses"? On your honour now, don't look it up.
Be careful: don't give people the codepoint number in these challenges, because a lot of input systems let you enter any character by keying in the codepoint.
So David has made it clear.
Here's a better challenge: Type five unique open parenthesis signs, without looking up their key sequences or codepoints.
Yes :-)
"Icon" is/was an interesting language. It did automatic conversions such as between numbers and strings. The problem with that was that it needed more operators. For example: "+" for addition and "++" for union. "|" for alternation, "|" for string concatenation and "|||" for list concatenation. "=" for numerical equals, "==" for string equals and "===" for value equals. It can be difficult to remember what each of a set of similar operators is used for. Python already has 3 pairs with (), [] and {}, and 2 of them have more than one use.