Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Turn a general position specification, such as a span, into a list of explicit positions
ResourceFunction["ToExplicitPosition"][expr, pos] returns a list of explicit positions of expr corresponding to the specification pos. |
Return an explicit list of positions given an expression and All as position specification:
In[1]:= |
Out[1]= |
Use a negative integer to return the explicit position of the last part of the top level:
In[2]:= |
Out[2]= |
Use ;; (Span):
In[3]:= |
Out[3]= |
Use UpTo:
In[4]:= |
Out[4]= |
Show deeper positions:
In[5]:= |
Out[5]= |
Show a list of positions:
In[6]:= |
Out[6]= |
Inside of heads:
In[7]:= |
Out[7]= |
Use Unevaluated to prevent evaluation:
In[8]:= |
Out[8]= |
Position with a level specification is the same up to reordering as ToExplicitPosition with appropriate combinations of All:
In[9]:= |
Out[9]= |
In[10]:= |
Out[10]= |
Integers inside Span only return valid positions compatible with the span specification:
In[11]:= |
Out[11]= |
In[12]:= |
Out[12]= |
This work is licensed under a Creative Commons Attribution 4.0 International License