8 Mar
2006
8 Mar
'06
2:31 a.m.
BJörn Lindqvist wrote:
do { cmd = readline() do_stuff_with_cmd(cmd); } while (!strcmp(cmd, "quit")); printf("Bye!"); exit(0);
KISS?
I believe there were concerns that rebinding quit would cause strange behavior. E.g.:
quit = False while not quit: ... quit $
Or:
if raw_input('quit?') == 'yes': ... quit
will that work? Should it? Functions are pretty predictable in comparison to these other options. So, at least to me, quit() == KISS -- Ian Bicking / ianb@colorstudy.com / http://blog.ianbicking.org