On Wednesday 06 December 2006 17:16, William Stein wrote: > 3. A substitution rule (?), which I guess doesn't have > any analogue in Python. I was confused before and didn't know > about 2 (above) and thought 3 was the only way to define a function. > Calculus rules don't make sense for these, but they can be > evaluated. > > In[36]:= z[x_, y_] := Sin[x+y] > > In[37]:= z[2,3] > > Out[37]= Sin[5]
Actually, you can do calculus with these too. In[12]:= f[x_]:=Sin[x] In[13]:= f'[x] Out[13]= Cos[x] In[14]:= f'[y] Out[14]= Cos[y] Of course, I don't believe the prime notation is an option for our python (with-out *very* ugly preparsing). -- Joel --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---
