Well, the Matrix matching function now works as described above:
@Arity( MatchMatrix( MatchInteger.n, MatchInteger.n ).x )
Now I am trying to see if I can write the rules for Derviative()...
--
http://mail.python.org/mailman/listinfo/python-list
Yes, it was a typo.
Even thought the function has not yet been bound to the name
"Factorial" when it calls the decorator, the function's __name__
attribute is set to it, so I use that to look up the name of the
generic.
Here''s the source for Arity:
def Arity( *pattern ):
"""A function decor
"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
Been playing around a bit more with developing my python inference
engine, and I thought it might be of general interest (plus, I am
finding the criticism useful).
My original goal was to brush up on my math skills. Now, I've long felt
that the best way to learn a language *thoroughly* is to write