Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

AbsoluteLevel again


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!

                                      Arturas Acus
Institute of Theoretical
Physics and Astronomy
Gostauto 12, 2600,Vilnius

   Fax: 370-2-225361
   Tel: 370-2-612906

  • Prev by Date: ValueList command
  • Next by Date: mathematica xpm
  • Prev by thread: Re: ValueList command
  • Next by thread: mathematica xpm