Wolfram Research

Function Repository Resource:

KillItWithFire

Source Notebook

Equivalent to DeleteObject, except uses fire to delete

Contributed by: Rick Hennigan

ResourceFunction["KillItWithFire"][expr]

kills expr with a suitable amount of fire.

Details and Options

ResourceFunction["KillItWithFire"] is effectively equivalent to DeleteObject but with added visual effect.

Examples

Basic Examples

Here's a LocalObject that's been infested with spiders:

In[1]:=
Put[Table[\!\(\*
NamespaceBox["LinguisticAssistant",
DynamicModuleBox[{Typeset`query$$ = "spiders", Typeset`boxes$$ = TemplateBox[{"\"spiders\"", 
RowBox[{"Entity", "[", 
RowBox[{"\"Species\"", ",", "\"Order:Araneae\""}], "]"}], "\"Entity[\\\"Species\\\", \\\"Order:Araneae\\\"]\"", "\"species specification\""}, "Entity"], Typeset`allassumptions$$ = {{
       "type" -> "Clash", "word" -> "spiders", "template" -> "Assuming \"${word}\" is ${desc1}. Use as \
${desc2} instead", "count" -> "3", "Values" -> {{
          "name" -> "Species", "desc" -> "a species specification", "input" -> "*C.spiders-_*Species-"}, {
          "name" -> "Word", "desc" -> "a word", "input" -> "*C.spiders-_*Word-"}, {
          "name" -> "MLBTeam", "desc" -> "an MLB team", "input" -> "*C.spiders-_*MLBTeam-"}}}}, Typeset`assumptions$$ = {}, Typeset`open$$ = {1}, Typeset`querystate$$ = {
      "Online" -> True, "Allowed" -> True, "mparse.jsp" -> 0.5009422, "Messages" -> {}}}, 
DynamicBox[ToBoxes[
AlphaIntegration`LinguisticAssistantBoxes["", 4, Automatic, 
Dynamic[Typeset`query$$], 
Dynamic[Typeset`boxes$$], 
Dynamic[Typeset`allassumptions$$], 
Dynamic[Typeset`assumptions$$], 
Dynamic[Typeset`open$$], 
Dynamic[Typeset`querystate$$]], StandardForm],
ImageSizeCache->{68., {9.5, 15.5}},
TrackedSymbols:>{
        Typeset`query$$, Typeset`boxes$$, Typeset`allassumptions$$, Typeset`assumptions$$, Typeset`open$$, Typeset`querystate$$}],
DynamicModuleValues:>{},
UndoTrackedVariables:>{Typeset`open$$}],
BaseStyle->{"Deploy"},
DeleteWithContents->True,
Editable->False,
SelectWithContents->True]\), 10], LocalObject["spiders"]]
Out[1]=
In[2]:=
Get[LocalObject["spiders"]]
Out[2]=

It's too late to save this one; kill it with fire:

In[3]:=
ResourceFunction["KillItWithFire"][LocalObject["spiders"]]
Out[3]=

No more spiders:

In[4]:=
FileExistsQ[LocalObject["spiders"]]
Out[4]=

Here's a new Databin:

In[5]:=
bin = CreateDatabin[]
Out[5]=

It has some data:

In[6]:=
DatabinUpload[bin, {1, 2, 3, 4, 5}]
Out[6]=

It also has some spiders:

In[7]:=
DatabinUpload[bin, Table[\!\(\*
NamespaceBox["LinguisticAssistant",
DynamicModuleBox[{Typeset`query$$ = "spiders", Typeset`boxes$$ = TemplateBox[{"\"spiders\"", 
RowBox[{"Entity", "[", 
RowBox[{"\"Species\"", ",", "\"Order:Araneae\""}], "]"}], "\"Entity[\\\"Species\\\", \\\"Order:Araneae\\\"]\"", "\"species specification\""}, "Entity"], Typeset`allassumptions$$ = {{
       "type" -> "Clash", "word" -> "spiders", "template" -> "Assuming \"${word}\" is ${desc1}. Use as \
${desc2} instead", "count" -> "3", "Values" -> {{
          "name" -> "Species", "desc" -> "a species specification", "input" -> "*C.spiders-_*Species-"}, {
          "name" -> "Word", "desc" -> "a word", "input" -> "*C.spiders-_*Word-"}, {
          "name" -> "MLBTeam", "desc" -> "an MLB team", "input" -> "*C.spiders-_*MLBTeam-"}}}}, Typeset`assumptions$$ = {}, Typeset`open$$ = {1}, Typeset`querystate$$ = {
      "Online" -> True, "Allowed" -> True, "mparse.jsp" -> 0.4919306, "Messages" -> {}}}, 
DynamicBox[ToBoxes[
AlphaIntegration`LinguisticAssistantBoxes["", 4, Automatic, 
Dynamic[Typeset`query$$], 
Dynamic[Typeset`boxes$$], 
Dynamic[Typeset`allassumptions$$], 
Dynamic[Typeset`assumptions$$], 
Dynamic[Typeset`open$$], 
Dynamic[Typeset`querystate$$]], StandardForm],
ImageSizeCache->{68., {9.5, 15.5}},
TrackedSymbols:>{
        Typeset`query$$, Typeset`boxes$$, Typeset`allassumptions$$, Typeset`assumptions$$, Typeset`open$$, Typeset`querystate$$}],
DynamicModuleValues:>{},
UndoTrackedVariables:>{Typeset`open$$}],
BaseStyle->{"Deploy"},
DeleteWithContents->True,
Editable->False,
SelectWithContents->True]\), 5]]
Out[7]=
In[8]:=
bin["Values"]
Out[8]=

You know what to do:

In[9]:=
ResourceFunction["KillItWithFire"][bin]
Out[9]=

The Databin has been incinerated:

In[10]:=
bin
Out[10]=

Here are some persistent spiders:

In[11]:=
PersistentValue["spiders"] = Table[\!\(\*
NamespaceBox["LinguisticAssistant",
DynamicModuleBox[{Typeset`query$$ = "spiders", Typeset`boxes$$ = TemplateBox[{"\"spiders\"", 
RowBox[{"Entity", "[", 
RowBox[{"\"Species\"", ",", "\"Order:Araneae\""}], "]"}], "\"Entity[\\\"Species\\\", \\\"Order:Araneae\\\"]\"", "\"species specification\""}, "Entity"], Typeset`allassumptions$$ = {{
        "type" -> "Clash", "word" -> "spiders", "template" -> "Assuming \"${word}\" is ${desc1}. Use as \
${desc2} instead", "count" -> "3", "Values" -> {{
           "name" -> "Species", "desc" -> "a species specification", "input" -> "*C.spiders-_*Species-"}, {
           "name" -> "Word", "desc" -> "a word", "input" -> "*C.spiders-_*Word-"}, {
           "name" -> "MLBTeam", "desc" -> "an MLB team", "input" -> "*C.spiders-_*MLBTeam-"}}}}, Typeset`assumptions$$ = {}, Typeset`open$$ = {1}, Typeset`querystate$$ = {
       "Online" -> True, "Allowed" -> True, "mparse.jsp" -> 0.5499057,
         "Messages" -> {}}}, 
DynamicBox[ToBoxes[
AlphaIntegration`LinguisticAssistantBoxes["", 4, Automatic, 
Dynamic[Typeset`query$$], 
Dynamic[Typeset`boxes$$], 
Dynamic[Typeset`allassumptions$$], 
Dynamic[Typeset`assumptions$$], 
Dynamic[Typeset`open$$], 
Dynamic[Typeset`querystate$$]], StandardForm],
ImageSizeCache->{68., {9.5, 15.5}},
TrackedSymbols:>{
         Typeset`query$$, Typeset`boxes$$, Typeset`allassumptions$$, Typeset`assumptions$$, Typeset`open$$, Typeset`querystate$$}],
DynamicModuleValues:>{},
UndoTrackedVariables:>{Typeset`open$$}],
BaseStyle->{"Deploy"},
DeleteWithContents->True,
Editable->False,
SelectWithContents->True]\), 5];
In[12]:=
#["Value"] & /@ PersistentObjects["spiders"]
Out[12]=

Fire is more persistent:

In[13]:=
ResourceFunction["KillItWithFire"][PersistentObjects["spiders"]]
Out[13]=

Resource History

Related Resources

License Information