Thanks to everybody who suggested solutions for AbsoluteLevel.
Unfortunatelly, I did not manage to express want I actually want. Here
is one more try.
I define a function:
Where "FindAbsoluteLevel "
, as Daniel Lichtblau noted, is a nesting-depth-counter in respect to
outermost level of evaluation at that particular moment, when pattern
matching occurs. (of course pattern matching occurs at some Level. I
only want to KNOW at which Level it sits at that moment)
When applied to :
I want the the following substitution take place
because only "a" is at Level one:
I suspect (as Dave Withoff noted) that I could never use this
FindAbsoluteLevel if I climb to the outermost Level. So is it
possible to have such a function? Can I know evaluation level at the
moment without evaluation the whole expression? Actually I want to
return to the point of evaluation after checking condition.
I want to note that there is no probllem at all to replace inner foo:
simply check FreeQ. I want to replace outermost foo and associate
the replacemant rule with name foo!
Institute of Theoretical
Physics and Astronomy
Gostauto 12, 2600,Vilnius
Prev by Date:
Next by Date:
Prev by thread:
Re: ValueList command
Next by thread: