Kiuhnm <kiuhnm03.4t.yahoo.it> wrote:
>
>That won't do. A good example is when you pass a function to re.sub, for
>instance.
This is an odd request.
I often pass functions to functions in order to simulate a C switch
statement, such as in a language translator:
commands = {
'add': doAdd,
'subtract' : doSubtract,
'multiply' : doMultiply,
'divide' : doDivide
}
nextCommand = parseCommandLine( line )
invokeCommand( commands[NextCommand] )
--
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list