0
$\begingroup$

I want to represent expressions mostly in unevaluated form, but being able to evaluate it's subparts.

For example, how to evaluate only arguments, but leave topmost expression unevaluated?

For example, so that

1 + Cos[0]

give

1 + 1

UPDATE

I want Mathematica to act something like follows.

If I write

<something> 1 + Cos[0]

it should respond with

<something> 1 + Cos[0]

i.e. having expression as is, unevaluated

Then if I enter something

<something> 1 + Evaluate[Cos[0]]

it should respond with

<something> 1 + 1

I.e. I want to CONTROL evaluation, not allowing Mathematica to evaluate what it wants. Only what I want.

Imagine gradual scholar math text where expression is converted gradually portion by portion and presented at intermediate stages.

Since I don't know how it can be implemented, I am not describing this with much detail. It can be some combination of holding heads or some global modes turnable on and off.

The goal is not to loose my work done while entering long expressions, which Mathematica tends to throw out by evaluating.

The solution should not be complex like in referred answer, it should be some simple built-in feature.

$\endgroup$
6
  • 1
    $\begingroup$ $\sin\,0\neq 1$. $\endgroup$ Jun 16, 2013 at 16:48
  • 1
    $\begingroup$ @Jens What is being requested is not quite the same, I think. But the question is ill-formed. The general answer seems to be to use something like Trott-Strzebonski technique: 1,2,3. $\endgroup$ Jun 16, 2013 at 18:21
  • $\begingroup$ @LeonidShifrin Maybe - I don't know what it means to "give" 1 + 1. What is the context? Surely, one can't expect that this is supposed to happen globally to all expressions entered by the user? $\endgroup$
    – Jens
    Jun 16, 2013 at 19:02
  • $\begingroup$ @Jens I don't know either. This is why I said that I think the question is ill-formed. $\endgroup$ Jun 16, 2013 at 19:15
  • $\begingroup$ Check Leonid's advice. For example, Hold[expr]/.c_Cos:>Block[{},c/;True] $\endgroup$
    – Rojo
    Jun 16, 2013 at 20:58

0

Browse other questions tagged or ask your own question.