[Edu-sig] explaining functions [Possibly OT]

Gregor Lingl glingl at aon.at
Mon Dec 6 01:24:02 CET 2004



Laura Creighton schrieb:

This examples shows beautifully that there are different concepts of 
"function", which
also shows up in Python: some are called to return a result - this *should*
be independent of global circumstances (variables). (Like mathematical 
functions
mentioned in Nicholas' posting.)
The others are functions that *do* something, for instance draw a line 
(like forward
from the turtle graphics module). What forward(50) produces is by no means
independent of the state of the machine. (And it returns None!) So these 
are called
merely because of their side-effects.

And (regrettably?) there are many functions which do both: produce 
side-effects
and return values (in the real world (especially of students)).

>And the climax was when I made them fix _each others_ code to make it produce
>the correct results.  I was called 'mean' for that.  :-)
>
>  
>
By all means, what does 'mean' mean in this context?
Gregor

>Laura
>
>_______________________________________________
>Edu-sig mailing list
>Edu-sig at python.org
>http://mail.python.org/mailman/listinfo/edu-sig
>
>
>  
>


More information about the Edu-sig mailing list