Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Evaluate the contents of the previous cell
ResourceFunction["EvaluatePreviousCell"][] evaluates the cell directly above the currently evaluating cell. | |
ResourceFunction["EvaluatePreviousCell"][n] evaluates the nth previous cell. |
Refer to an object that took substantial resources to compute:
| In[1]:= |
|
| Out[1]= |
|
| In[2]:= |
|
| Out[2]= |
|
Use a graphical object that typically slows down the user interface when interacted with (e.g. over a slow remote connection):
| In[3]:= |
|
| Out[3]= |
|
| In[4]:= |
|
| Out[4]= |
|
Refer to an expression not immediately previous to the current one:
| In[5]:= |
|
| Out[5]= |
|
Ignore text cells when counting:
| In[6]:= |
|
| Out[6]= |
|
Text cells do not evaluate if their contents are not evaluable:
| In[7]:= |
|
| Out[7]= |
|
Referring to the input cell of an input-output cell group reevaluates the input, leading to repeated computations:
| In[8]:= |
|
| Out[8]= |
|
| In[9]:= |
|
| Out[9]= |
|
Refer to the generated output cell instead, which is not evaluated any further:
| In[10]:= |
|
| Out[10]= |
|
| In[11]:= |
|
| Out[11]= |
|
If n refers to a nonexistent cell, a ToExpression::notstrbox is produced:
| In[12]:= |
|
| Out[12]= |
|
If the cell being referred to contains an evaluable instance of EvaluatePreviousCell, recursion errors may occur:
| In[13]:= |
|
| In[14]:= |
|
| Out[14]= |
|
Avoid reevaluating EvaluatePreviousCell by matching only output cells:
| In[15]:= |
|
| Out[15]= |
|
Use the binary representation of expressions to store and retrieve persistent data within the notebook:
| In[16]:= |
|
| In[17]:= |
|
| Out[17]= |
|
| In[18]:= |
|
| Out[18]= |
|
This work is licensed under a Creative Commons Attribution 4.0 International License