Conditional operator in Python?

Dan Schmidt dfan at harmonixmusic.com
Fri Apr 6 09:36:11 EDT 2001


"Tim Peters" <tim.one at home.com> writes:

| > How does that compare to Knuth's view?
| 
| Uncle Don and I have never disagreed on this point!  Don't go looking to stir
| up trouble, Andrew.  If you must, join me in complaining about his C coding
| style.  Like:
| 
|   t=TT-1; while (t) {
|     for (j=KK-1;j>0;j--) ul[j+j]=ul[j],u[j+j]=u[j];     /* "square" */
|     for (j=KK+KK-2;j>KK-LL;j-=2)
|         ul[KK+KK-1-j]=0.0,u[KK+KK-1-j]=u[j]-ul[j];
|
| [...]
|
| taken from an especially impenetrable section of
| 
|     http://www-cs-staff.stanford.edu/~uno/programs/rng-double.c
| 
| Time to rewrite the TAoCP series in Python, yes?

Aw, that's not really fair, given that he does all his programming in
CWEB these days, for better or worse, and this is in straight C just
so other people can grab it easily.

Knuth's coding style is kind of historical at this point, and is
emulated at one's peril, but I learned an immense amount by reading
through the TeX source code.

Waiting for MIXAL to become whitespace-significant,
Dan

-- 
http://www.dfan.org



More information about the Python-list mailing list