Returning none
Stephan Houben
stephan at pcrm.win.tue.nl
Fri Aug 27 03:34:20 EDT 1999
clgonsal at keeshah.penguinpowered.com (C.Laurence Gonsalves) writes:
> It is possible, but more complicated, to make this a compile time error.
> This would essentially require a function/procedure distinction with
> restrictions about how you used return in each one. There would still
> have to be a runtime error for cases where someone tried to get a result
> from a procedure, but cases like the above example could be caught at
> compile-time. (The above, being a function, must return a value.
> Procedures would have to defined in some other way, like using some new
> keyword "proc" in place of "def")
Moreover, this would require different syntax when *calling* the
function/procedure. Let's say, procedure names start with `&' ?
<wink>
Greetings,
Stephan
More information about the Python-list
mailing list