"talin at acm dot org" <[EMAIL PROTECTED]> writes: > # Declare that "Factor" is a generic function > Factorial = Function()
Was the comment a typo for Factorial? > # Define Factorial( 0 ) > @Arity( 0 ) > def Factorial(): > return 1 Overriding old definition of Factorial > # Define Factorial( x ) > @Arity( MatchInteger.x ) > def Factorial( x ): > return x * Factorial( x - 1 ) Overriding it again > print Factorial( 12 ) I'm confused, how did it know what to do? Are you using some reflection hack in the MatchInteger decorator to figure out the function name? -- http://mail.python.org/mailman/listinfo/python-list