On Aug 29, 2019, at 16:32, Guido van Rossum <guido@python.org> wrote:
Surely the meaning of `?` in a programming language also has to be learned. And not every language uses it to mean "optional" (IIRC there's a language where it means "boolean" -- maybe Scheme?)
Sure, ? does mean lots of different things that have nothing to do with Optional. The C ?: operator is probably the most famous. But as an operator on types, I can’t think of any uses other than Optional. But, just for fun: * ?: from C * null-coalescing, as in C# * Optional-chaining, as in Swift * throwing, as in Rust *’ordinary identifier character, usually idiomatically predicate functions end in ?, as in Scheme * ordinary operator (as opposed to identifier) character, used for a wide variety of completely unrelated monad things you don’t want to know about, as in Haskell * special 1-char identifier that’s idiomatically sort of like _ from C/gettext, as in Smalltalk * expand as macro, as in… Erlang? * print, as in Basic * random, as in APL * whatever the hell Ruby is doing that gives me "P" in one interpreter and 80 in another when I type ?P. Ruby _also_ has ? as an id-cont character, with the Schemeish convention, and the ?: operator, and in some other contexts it’s a syntax error but in some it does… whatever that string-or-ord thing is.