@@ -1001,14 +1001,12 @@ Cell[BoxData[
1001
1001
RowBox [{"listener" , "," , " " , "id" }], "]" }]}], "," , "\n " ,
1002
1002
"\t\t\t\t " ,
1003
1003
RowBox [{"\"\< Variable\>\" " , "\[ Rule]" ,
1004
- RowBox [{"HoldPattern" , "[" , "listener" , "]" }]}], "," , "\n " ,
1005
- "\t\t\t\t " ,
1004
+ RowBox [{"Hold" , "[" , "listener" , "]" }]}], "," , "\n " , "\t\t\t\t " ,
1006
1005
RowBox [{"\"\< Callback\>\" " , "\[ Rule]" ,
1007
- RowBox [{"HoldPattern" , "[" , "callback" , "]" }]}]}], "\n " , "\t\t\t\t " ,
1008
- "|>" }]}], "\n " , "\t\t\t " , "]" }]}]}], "\n " , "\t\t " ,
1009
- "]" }]}]], "CodeInput" ,
1010
- CellLabel ->
1011
- "In[7340]:=" ,ExpressionUUID -> "8f082985-3a4a-4257-8966-71a48256bd86" ]
1006
+ RowBox [{"Hold" , "[" , "callback" , "]" }]}]}], "\n " , "\t\t\t\t " ,
1007
+ "|>" }]}], "\n " , "\t\t\t " , "]" }]}]}], "\n " , "\t\t " ,
1008
+ "]" }]}]], \
1009
+ "CodeInput" ,ExpressionUUID -> "8f082985-3a4a-4257-8966-71a48256bd86" ]
1012
1010
}, Closed ]],
1013
1011
1014
1012
Cell [CellGroupData [{
@@ -1028,16 +1026,14 @@ Cell[BoxData[{
1028
1026
1029
1027
RowBox [{
1030
1028
RowBox [{
1031
- RowBox [{"Verbatim" , "[" , "HoldPattern " , "]" }], "[" , "var_" , "]" }], ":>" ,
1032
- "\n " , " \ t\t\t " ,
1029
+ RowBox [{"Verbatim" , "[" , "Hold " , "]" }], "[" , "var_" , "]" }], ":>" , " \n " ,
1030
+ "\t\t\t " ,
1033
1031
RowBox [{"Set" , "[" ,
1034
1032
RowBox [{"var" , "," , " " , "val" }], "]" }]}]}], "\n " , "\t\t\t " , "]" }]}],
1035
1033
";" }], "\n " ,
1036
1034
RowBox [{
1037
1035
RowBox [{"setListenerCallback" , "~" , "SetAttributes" , "~" , "HoldRest" }],
1038
- ";" }]}], "CodeInput" ,
1039
- CellLabel ->
1040
- "In[7341]:=" ,ExpressionUUID -> "47fbc8d1-d00f-44e3-9831-df876d7a04cd" ],
1036
+ ";" }]}], "CodeInput" ,ExpressionUUID -> "47fbc8d1-d00f-44e3-9831-df876d7a04cd" ],
1041
1037
1042
1038
Cell [BoxData [{
1043
1039
RowBox [{
@@ -1050,17 +1046,15 @@ Cell[BoxData[{
1050
1046
RowBox [{"li" , "," , "\"\< Callback\>\" " }], "]" }], "," , "\n " , "\t\t " ,
1051
1047
RowBox [{
1052
1048
RowBox [{
1053
- RowBox [{"Verbatim" , "[" , "HoldPattern " , "]" }], "[" , "var_" , "]" }], ":>" ,
1054
- "\n " , " \ t\t\t " ,
1049
+ RowBox [{"Verbatim" , "[" , "Hold " , "]" }], "[" , "var_" , "]" }], ":>" , " \n " ,
1050
+ "\t\t\t " ,
1055
1051
RowBox [{"SetDelayed" , "[" ,
1056
1052
RowBox [{"var" , "," , " " , "val" }], "]" }]}]}], "\n " , "\t\t\t " , "]" }]}],
1057
1053
";" }], "\n " ,
1058
1054
RowBox [{
1059
1055
RowBox [{
1060
1056
"setListenerCallbackDelayed" , "~" , "SetAttributes" , "~" , "HoldRest" }],
1061
- ";" }]}], "CodeInput" ,
1062
- CellLabel ->
1063
- "In[7342]:=" ,ExpressionUUID -> "19586cb2-f9aa-4ec8-9b49-78d5bc5f1bce" ],
1057
+ ";" }]}], "CodeInput" ,ExpressionUUID -> "19586cb2-f9aa-4ec8-9b49-78d5bc5f1bce" ],
1064
1058
1065
1059
Cell [BoxData [{
1066
1060
RowBox [{"callbackFailure" , "~" , "SetAttributes" , "~" , "HoldRest" }], "\n " ,
@@ -1145,11 +1139,11 @@ Cell[BoxData[{
1145
1139
RowBox [{"li" , "[" , "\"\< Name\>\" " , "]" }], "," , " " , "args" }], "]" }],
1146
1140
"=!=" , "False" }], "," , "\n " , "\t\t\t " ,
1147
1141
RowBox [{"Replace" , "[" ,
1148
- RowBox [{"sym" , "," , "\n " , "\t " , " \t\t\t " ,
1142
+ RowBox [{"sym" , "," , "\n " , "\t\t\t\t " ,
1149
1143
RowBox [{
1150
1144
RowBox [{
1151
- RowBox [{"Verbatim" , "[" , "HoldPattern " , "]" }], "[" , "var_" , "]" }],
1152
- ":>" , " \n " , "\t " , "\t\t\t\t " ,
1145
+ RowBox [{"Verbatim" , "[" , "Hold " , "]" }], "[" , "var_" , "]" }], ":>" ,
1146
+ "\n " , "\t " , "\t\t\t\t " ,
1153
1147
RowBox [{"With" , "[" ,
1154
1148
RowBox [{
1155
1149
RowBox [{"{" ,
@@ -1174,9 +1168,8 @@ Cell[BoxData[{
1174
1168
RowBox [{"listenerObject" , "[" , "name" , "]" }], "," , " " , "method" , "," ,
1175
1169
" " , "fn" , "," , " " , "args" }], "]" }]}], ";" }], "\n " ,
1176
1170
RowBox [{"updateListenerTemplate" , "~" , "SetAttributes" , "~" ,
1177
- "HoldAllComplete" }]}], "CodeInput" ,
1178
- CellLabel ->
1179
- "In[7345]:=" ,ExpressionUUID -> "7f1d3af1-cef1-4bea-8872-d8d53e2c3772" ]
1171
+ "HoldAllComplete" }]}], \
1172
+ "CodeInput" ,ExpressionUUID -> "7f1d3af1-cef1-4bea-8872-d8d53e2c3772" ]
1180
1173
}, Closed ]],
1181
1174
1182
1175
Cell [CellGroupData [{
@@ -1365,25 +1358,26 @@ Cell[BoxData[
1365
1358
RowBox [{"\"\< Remove\>\" " , "," , " " ,
1366
1359
RowBox [{"li" , "[" , "\"\< Name\>\" " , "]" }]}], "]" }], "=!=" , "False" }],
1367
1360
"," , "\n " , "\t\t\t " ,
1361
+ RowBox [{"(*" ,
1362
+ RowBox [{
1363
+ RowBox [{"Clear" , "@@" ,
1364
+ RowBox [{"Evaluate" , "[" ,
1365
+ RowBox [{"data" , "[" , "\"\< Variable\>\" " , "]" }], "]" }]}], ";" }],
1366
+ "*)" }], "\n " , "\t\t\t " ,
1368
1367
RowBox [{
1369
- RowBox [{"Clear" , "@@" ,
1370
- RowBox [{"Evaluate" , "[" ,
1371
- RowBox [{"data" , "[" , "\"\< Variable\>\" " , "]" }], "]" }]}], ";" , "\n " ,
1372
- "\t " , "\t\t " ,
1373
1368
RowBox [{"Internal`SetValueNoTrack" , "@@" ,
1374
1369
RowBox [{"Append" , "[" ,
1375
1370
RowBox [{
1376
- RowBox [{"Hold" , "@@" ,
1377
- RowBox [{"data" , "[" , "\"\< Variable\>\" " , "]" }]}], "," , " " ,
1371
+ RowBox [{"data" , "[" , "\"\< Variable\>\" " , "]" }], "," , " " ,
1378
1372
RowBox [{"data" , "[" , "\"\< ID\>\" " , "]" }]}], "]" }]}], ";" , "\n " ,
1379
1373
"\t\t\t " ,
1380
1374
RowBox [{"dropListener" , "[" , "li" , "]" }], ";" }], "," , "\n " , "\t\t\t " ,
1381
1375
RowBox [{"callbackFailure" , "[" ,
1382
1376
RowBox [{"\"\< Remove\>\" " , "," , " " ,
1383
1377
RowBox [{"li" , "[" , "\"\< Name\>\" " , "]" }]}], "]" }]}], "\n " , "\t\t\t " ,
1384
- "]" }]}], "\n " , "\t\t " , "]" }]}]], "CodeInput" ,
1385
- CellLabel ->
1386
- "In[7356]:= " ,ExpressionUUID -> "49fef233-b557-4314-82a5-61def3d84690" ]
1378
+ "]" }]}], "\n " , "\t\t " ,
1379
+ "]" }]}]], \
1380
+ "CodeInput " ,ExpressionUUID -> "49fef233-b557-4314-82a5-61def3d84690" ]
1387
1381
}, Closed ]],
1388
1382
1389
1383
Cell [CellGroupData [{
@@ -1501,16 +1495,16 @@ Cell[BoxData[
1501
1495
"\t\t\t\t\t " ,
1502
1496
RowBox [{
1503
1497
RowBox [{
1504
- RowBox [{"Verbatim" , "[" , "HoldPattern " , "]" }], "[" , "var_" , "]" }], ":>" ,
1505
- "\n " , "\t\t\t\t\t\t " ,
1498
+ RowBox [{"Verbatim" , "[" , "Hold " , "]" }], "[" , "var_" , "]" }], ":>" ,
1499
+ "\n " , "\t\t\t\t\t\t " ,
1506
1500
RowBox [{"DynamicBox" , "[" ,
1507
1501
RowBox [{"ToBoxes" , "@" , "var" }], "]" }]}]}], "\n " , "\t\t\t\t\t " ,
1508
1502
"]" }]}], "\n " , "\t\t\t " , "}" }], "," , "\n " , "\t\t " ,
1509
1503
RowBox [{"InterpretationBox" , "[" , "\n " , "\t\t\t " ,
1510
1504
RowBox [{"boxes" , "," , "\n " , "\t\t\t " , "li" }], "\n " , "\t\t\t " , "]" }]}],
1511
- "\n " , "\t\t " , "]" }]}]], "CodeInput" ,
1512
- CellLabel ->
1513
- "In[7363]:= " ,ExpressionUUID -> "62319269-f018-4994-8634-104d03028e68" ]
1505
+ "\n " , "\t\t " ,
1506
+ "]" }]}]], \
1507
+ "CodeInput " ,ExpressionUUID -> "62319269-f018-4994-8634-104d03028e68" ]
1514
1508
}, Closed ]]
1515
1509
}, Open ]],
1516
1510
@@ -1562,17 +1556,16 @@ Cell[BoxData[{
1562
1556
RowBox [{"#" , "," , " " , "\"\< Variable\>\" " }], "]" }], "&" }],
1563
1557
"," , " " , "lis" }], "]" }], "," , " " , "\n " , "\t\t\t\t\t\t\t " ,
1564
1558
RowBox [{
1565
- RowBox [{"Except" , "[" , "_HoldPattern" , "]" }], "\[ Rule]" ,
1566
- "Nothing" }], "," , " " , "\n " , "\t\t\t\t\t\t\t " , "1" }], "\n " ,
1567
- "\t\t\t\t\t\t\t " , "]" }], "," , "\n " , "\t\t\t\t\t\t " ,
1568
- "HoldPattern" }], "\n " , "\t\t\t\t\t\t " , "]" }], "," , "\n " ,
1569
- "\t\t\t\t\t " ,
1570
- RowBox [{"{" , "\n " , "\t " , "\t " , "\t " , "\t\t\t " ,
1559
+ RowBox [{"Except" , "[" , "_Hold" , "]" }], "\[ Rule]" , "Nothing" }],
1560
+ "," , " " , "\n " , "\t\t\t\t\t\t\t " , "1" }], "\n " , "\t\t\t\t\t\t\t " ,
1561
+ "]" }], "," , "\n " , "\t\t\t\t\t\t " , "Hold" }], "\n " , "\t\t\t\t\t\t " ,
1562
+ "]" }], "," , "\n " , "\t\t\t\t\t " ,
1563
+ RowBox [{"{" , "\n " , "\t\t\t\t\t\t " ,
1571
1564
RowBox [{
1572
1565
RowBox [{
1573
1566
RowBox [{
1574
- RowBox [{"Verbatim" , "[" , "HoldPattern " , "]" }], "[" , "s_" , "]" }],
1575
- ":>" , " \n " , "\t " , "\t " , "\t " , "\t " , "\t\t\t " ,
1567
+ RowBox [{"Verbatim" , "[" , "Hold " , "]" }], "[" , "s_" , "]" }], ":>" ,
1568
+ "\n " , "\t " , "\t " , "\t " , "\t " , "\t\t\t " ,
1576
1569
RowBox [{"DynamicBox" , "[" , "\n " , "\t\t\t\t\t\t\t\t " ,
1577
1570
RowBox [{
1578
1571
RowBox [{"s" , ";" , "\n " , "\t\t\t\t\t\t\t\t " ,
@@ -1627,9 +1620,8 @@ Cell[BoxData[{
1627
1620
"\n " , "\t\t " , "ops" }], "\n " , "\t\t " , "]" }]}], ";" }], "\n " ,
1628
1621
RowBox [{
1629
1622
RowBox [{"ListenerDynamic" , "~" , "SetAttributes" , "~" , "HoldFirst" }],
1630
- ";" }]}], "CodeInput" ,
1631
- CellLabel ->
1632
- "In[7364]:=" ,ExpressionUUID -> "5a638b84-5a1d-4753-9270-9f29feb0f613" ]
1623
+ ";" }]}], "CodeInput" ,ExpressionUUID -> "5a638b84-5a1d-4753-9270-9f29feb0f613" ]\
1624
+
1633
1625
}, Closed ]]
1634
1626
}, Open ]],
1635
1627
@@ -1661,7 +1653,7 @@ Cell[BoxData[
1661
1653
1662
1654
Cell [BoxData [
1663
1655
RowBox [{"ContextRemove" , "[" , "\"\< Listeners`\>\" " , "]" }]], "Input" ,
1664
- CellLabel -> "In[52 ]:=" ,ExpressionUUID -> "18ff1545-8615-4a25-a139-40aff5aab986" ],
1656
+ CellLabel -> "In[67 ]:=" ,ExpressionUUID -> "18ff1545-8615-4a25-a139-40aff5aab986" ],
1665
1657
1666
1658
Cell [BoxData [
1667
1659
RowBox [{"Block" , "[" ,
@@ -1672,54 +1664,29 @@ Cell[BoxData[
1672
1664
RowBox [{"$Path" , "," , " " ,
1673
1665
RowBox [{"NotebookDirectory" , "[" , "]" }]}], "]" }]}], "}" }], "," ,
1674
1666
RowBox [{"<<" , "Listeners`" }]}], "]" }]], "Input" ,
1675
- CellLabel -> "In[53 ]:=" ,ExpressionUUID -> "8e495724-0684-4e7a-bd54-a76edba3ae72" ],
1667
+ CellLabel -> "In[68 ]:=" ,ExpressionUUID -> "8e495724-0684-4e7a-bd54-a76edba3ae72" ],
1676
1668
1677
1669
Cell [BoxData [
1678
1670
RowBox [{"Get" , "[" ,
1679
1671
"\"\< https://github.com/b3m2a1/mathematica-tools/raw/master/Listeners.m\>\" \
1680
1672
" , "]" }]], "Input" ,
1681
1673
CellLabel -> "In[42]:=" ,ExpressionUUID -> "b960096c-be8d-4007-b4dd-e2524ec07325" ],
1682
1674
1683
- Cell [CellGroupData [{
1684
-
1685
1675
Cell [BoxData [
1686
1676
RowBox [{
1687
- RowBox [{
1688
- RowBox [{"var" , "=" ,
1689
- RowBox [{"Listener" , "[" , "\"\< b\>\" " , "]" }]}], ";" }], "//" ,
1690
- "AbsoluteTiming" }]], "Input" ,
1691
- CellLabel -> "In[54]:=" ,ExpressionUUID -> "172272c7-1d8f-4fad-b479-e9bdba3502e6" ],
1692
-
1693
- Cell [BoxData [
1694
- RowBox [{"{" ,
1695
- RowBox [{"0.000108`" , "," , "Null" }], "}" }]], "Output" ,
1696
- CellLabel ->
1697
- "Out[54]=" ,ExpressionUUID -> "77a5fd57-fc54-4c99-8a34-4ea910be4e48" ]
1698
- }, Open ]],
1699
-
1700
- Cell [CellGroupData [{
1701
-
1702
- Cell [BoxData [
1703
- RowBox [{"var" , "=" ,
1704
- RowBox [{"2" , "//" , "AbsoluteTiming" }]}]], "Input" ,
1705
- CellLabel -> "In[55]:=" ,ExpressionUUID -> "16c797be-78c3-4a56-83b2-babf97dcf246" ],
1706
-
1707
- Cell [BoxData [
1708
- RowBox [{"{" ,
1709
- RowBox [{"1.`*^-6" , "," , "2" }], "}" }]], "Output" ,
1710
- CellLabel ->
1711
- "Out[55]=" ,ExpressionUUID -> "f1da6de5-1a88-4d83-b6b8-2c8f48c46b09" ]
1712
- }, Open ]],
1677
+ RowBox [{"var" , "=" ,
1678
+ RowBox [{"Listener" , "[" , "\"\< b\>\" " , "]" }]}], ";" }]], "Input" ,
1679
+ CellLabel -> "In[69]:=" ,ExpressionUUID -> "172272c7-1d8f-4fad-b479-e9bdba3502e6" ],
1713
1680
1714
1681
Cell [CellGroupData [{
1715
1682
1716
1683
Cell [BoxData [
1717
1684
RowBox [{"var" , "//" , "InputForm" }]], "Input" ,
1718
- CellLabel -> "In[57 ]:=" ,ExpressionUUID -> "c7d4739a-f5cc-4eb4-a557-7f8f362cbc7a " ],
1685
+ CellLabel -> "In[70 ]:=" ,ExpressionUUID -> "90ad8742-afd8-4f85-a499-a12b58fa012a " ],
1719
1686
1720
1687
Cell ["Listener[\" b\" ]" , "Output" ,
1721
1688
CellLabel ->
1722
- "Out[57 ]//InputForm=" ,ExpressionUUID -> "51bc755f-4197-468a-b1d8-993fd455a75e " ]
1689
+ "Out[70 ]//InputForm=" ,ExpressionUUID -> "61bebb46-3ecb-4e8c-b950-a220b8ee5d16 " ]
1723
1690
}, Open ]],
1724
1691
1725
1692
Cell [BoxData [
@@ -1733,17 +1700,17 @@ Cell[BoxData[
1733
1700
RowBox [{"BoxData" , "@" ,
1734
1701
RowBox [{"ToBoxes" , "@" , "expr" }]}], "]" }], "," , " " ,
1735
1702
"\"\< PlainText\>\" " }], "]" }]}]}]}]], "Input" ,
1736
- CellLabel -> "In[50 ]:=" ,ExpressionUUID -> "252b6b75-1e26-40e5-8d58-22cb6bcb11e8" ],
1703
+ CellLabel -> "In[63 ]:=" ,ExpressionUUID -> "252b6b75-1e26-40e5-8d58-22cb6bcb11e8" ],
1737
1704
1738
1705
Cell [CellGroupData [{
1739
1706
1740
1707
Cell [BoxData [
1741
1708
RowBox [{"displayedForm" , "@" , "var" }]], "Input" ,
1742
- CellLabel -> "In[51 ]:=" ,ExpressionUUID -> "9ec3414a-1f76-40d5-86df-2752faac0304" ],
1709
+ CellLabel -> "In[71 ]:=" ,ExpressionUUID -> "9ec3414a-1f76-40d5-86df-2752faac0304" ],
1743
1710
1744
1711
Cell [BoxData ["\<\" Null\"\> " ], "Output" ,
1745
1712
CellLabel ->
1746
- "Out[51 ]=" ,ExpressionUUID -> "a2eb885d-4ecb-40d6-8333-f5bd4490b18d " ]
1713
+ "Out[71 ]=" ,ExpressionUUID -> "c31e1e7b-50bb-4a8d-b111-281275282f8a " ]
1747
1714
}, Open ]],
1748
1715
1749
1716
Cell [CellGroupData [{
0 commit comments