> Btw, as usual, I would learn from what Mathematica is doing, because
> the Hold(...) stuff seams really simple to me. So maybe the evaluate
> keyword should be used in Python. We use the "evaluate" keyword
> inconsistently in sympy so far.

Here is Mathematica's documentation for Hold:

http://reference.wolfram.com/mathematica/ref/Hold.html

In [1]: Hold[Evaluate[1 + 1], 2 + 2]
Out[1]: Hold[2, 2+2]

so this could be translated to Python along these lines:

In [1]: [1+1, Hold(2+2)]
Out[1] [2, 2+2]

Where Hold function would just set some (global?) parameter for the
__add__ function not to evaluate the stuff. I don't like this option
much though. Another option:


In [2]: [1+1, Add(2, 2, evaluate=False)]
Out[2]: [2, 2 + 2]

In fact, I executed [2] in SymPy...

But honestly, Mathematica's way Hold[2+2] is simpler than Add(2, 2,
evaluate=False).

So, opinions on this? I don't like preparsing.

Ondrej

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to