lambdak: multi-line lambda implementation in native Python

Steven D'Aprano steve+comp.lang.python at pearwood.info
Thu Jan 15 23:16:16 EST 2015


Rustom Mody wrote:

> Let there be a hundred different versions, then people will
> begin to clamor against the non-necessity of the penury-of-ASCII:
> 
> http://blog.languager.org/2015/01/unicode-and-universe.html

Almost 30 years ago, Apple's Hypertalk language allowed, and encouraged, the
use of certain non-ASCII symbols. You could use ≤ ≥ and ≠ for
less-or-equal, greater-or-equal, and not-equal comparisons; you could use ÷
for division; and you could define a square root function using √ as the
name. You could even define ∞ = 'INF' and do floating point operations on
it.

Apple could get away with this back in the 80s because they controlled the
platform including keyboard mappings, and they could guarantee that key
combinations such as Option-/ would generate the ÷ character and that any
reasonable font would include a glyph for it.

Alas and alack, 30 years on and we have to live with the down-side of
multicultural computers. Any modern Linux system is almost sure to be fully
Unicode compatible with a UTF-8 filesystem -- *almost* sure. But we have to
interoperate with Windows machines still stuck in the Dark Ages of "code
pages"; Java that insists that Unicode == UTF-16 (and support for the
supplementary multilingual planes is weak); there is a plethora of fonts
but Unicode support is extremely variable; many of us are using US
keyboards and there's no well-known or standard input method for Unicode
characters; and while Apple only had to support somewhat fewer than 256
characters, Unicode has tens of thousands.

Before Unicode can take off for programming syntax, we need to solve at
least four problems:

- we need a good selection of decent programmer's fonts with 
  extensive support for Unicode especially mathematical symbols;

- we need a platform-independent input method that will allow 
  programmers to enter these symbols without moving their hands 
  off the keyboard;

- and some way to make the existence of these symbols easily 
  discoverable, e.g. for most of us, ~ is easily discoverable 
  because we can see it on the keyboard, but the same doesn't
  apply for ≈

- we have to be confident that moving source code from one 
  machine to another (Windows -> Linux or visa versa) won't
  corrupt the file. That means UTF-8 everywhere.

I live in hope, but I am not confident that these issues will be solved in
my lifetime. One of the ten most popular programming languages, PHP,
doesn't even support Unicode even as a data type. What hope do we have?



-- 
Steven




More information about the Python-list mailing list