When I was at Data General, writing C (and a little C++), we had a set of internal coding conventions that mandated a single return point for a function. Goto's were used during error checks to branch to the function exit; something like this:
int
frodo() {
int rval = 0;
if (bilbo() != 0) {
rval = -1;
goto leave;
}
if (gandalf() != 0) {
rval = -1;
goto leave;
}
/* lot's of code here */
leave:
return rval;
}
Made sense to me.
-- david
--
http://mail.python.org/mailman/listinfo/python-list
