ev is a rather confusing routine, and I won't claim to describe it in
detail. But in brief, in ev(..., XXX), the XXX may be:
* a symbol
** with a special interpretation (noeval, nouns, expand, ...)
** a variable name with the evflags property, in which case it is bound to
true (simp, float, exponentialize, ...)
** a function name, in which case that function is de-nounified within the
expression (diff, sum, ...)
** another symbol, in which case it is evaluated; its value should be a
list, which is treated as arguments to ev
* an assignment or equation (a:3 or a=3), in which case that variable is
bound locally to that value
* a function definition, in which case that function is bound locally to
that definition
So
ev( ..., simp) is equivalent to ev( ..., simp:true), which is (roughly)
equivalent to block([simp:true], ...)
and
ev( ..., simp:false) is (roughly) equivalent to block([simp:false], ...)
This is all documented in ? ev, though the documentation may be hard to
understand.
Recall that the *value* of the ev expression will be simplified with the
value of simp *outside* the ev expression.
For example:
print( ev( print( 1 + 1 ), simp: false ));
prints
1 + 1 the unsimplified inner result
2 gets simplified when ev returns its value
Hope this helps.
-s
On Mon, Aug 31, 2009 at 7:22 PM, Alejandro Jakubi <jakubi at df.uba.ar> wrote:
> The examples for 'tellsimp' in the manual include the statement
>
> ev (tellsimp (0^0, 1), simp: false);
>
> I am intrigued about this form of argument "simp: false".
>
> The description for the arguments in an 'ev' function call say about
> 'simp':
>
> "simp causes expr to be simplified regardless of the setting of the switch
> simp
> which inhibits simplification if false."
>
> and I interpret this sentence as describing a situation like:
>
> (%i2) simp : false$
> (%i3) ev(1 + 1, simp);
> (%o3) 2
>
> rather than the previous one.
>
> So, I wonder whether this argument "simp: false" is undocumented. If so, in
> what cases does it work?, meaning, I guess, evaluate but avoiding automatic
> simplification. I find that such an option, if available, could be useful
> occasionally.
>
> Alejandro Jakubi
>
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>