In this answer Carl Woll uses the ParentList
symbol to inherit old input aliases when adding a new one:
CurrentValue[EvaluationNotebook[],
InputAliases] = {"0x" ->
RowBox[{InterpretationBox[
StyleBox["\"0\"", ShowStringCharacters -> False],
Function[Null,
FromDigits[StringDrop[ToString@Unevaluated@#, 1], 16],
HoldAll]], "\[InvisibleApplication]", "\[InvisibleSpace]",
StyleBox["x", ShowAutoStyles -> False]}], ParentList};
CurrentValue[EvaluationNotebook[], InputAliases] /. Rule[a_, _] :> a
{"0x", ParentList}
And we can still use the all the basic built-in aliases
On the other-hand, we can get the same result using Inherited
:
CurrentValue[EvaluationNotebook[], InputAliases] = Inherited;
CurrentValue[EvaluationNotebook[],
InputAliases] = {"0x" ->
RowBox[{InterpretationBox[
StyleBox["\"0\"", ShowStringCharacters -> False],
Function[Null,
FromDigits[StringDrop[ToString@Unevaluated@#, 1], 16],
HoldAll]], "\[InvisibleApplication]", "\[InvisibleSpace]",
StyleBox["x", ShowAutoStyles -> False]}], Inherited};
CurrentValue[EvaluationNotebook[], InputAliases] /. Rule[a_, _] :> a
{"0x", Inherited}
And we can, again, use the all of the built-in aliases, but if we look at the AbsoluteCurrentValue
s for the first case:
CurrentValue[EvaluationNotebook[],
InputAliases] = {"0x" ->
RowBox[{InterpretationBox[
StyleBox["\"0\"", ShowStringCharacters -> False],
Function[Null,
FromDigits[StringDrop[ToString@Unevaluated@#, 1], 16],
HoldAll]], "\[InvisibleApplication]", "\[InvisibleSpace]",
StyleBox["x", ShowAutoStyles -> False]}], ParentList};
AbsoluteCurrentValue[EvaluationNotebook[], InputAliases] /.
Rule[a_, _] :> a
{"0x", "intt", "dintt", "sumt", "prodt", "dt", "ia", "cbrt", "surd", \
"ket", "bra", "braket", "delay", "grad", "del.", "delx", "del2", \
"notation", "notation>", "notation<", "symb", "infixnotation", \
"addia", "pattwraper", "madeboxeswraper"}
And the second:
CurrentValue[EvaluationNotebook[], InputAliases] = Inherited;
CurrentValue[EvaluationNotebook[],
InputAliases] = {"0x" ->
RowBox[{InterpretationBox[
StyleBox["\"0\"", ShowStringCharacters -> False],
Function[Null,
FromDigits[StringDrop[ToString@Unevaluated@#, 1], 16],
HoldAll]], "\[InvisibleApplication]", "\[InvisibleSpace]",
StyleBox["x", ShowAutoStyles -> False]}], Inherited};
AbsoluteCurrentValue[EvaluationNotebook[], InputAliases] /.
Rule[a_, _] :> a
{"0x", Inherited}
We see that even though they are operationally similar, the AbsoluteCurrentValue
result is different.
So I guess my question is, how do ParentList
and Inherited
differ outside of this small difference?
ParentList
is obviously more scoped to list-type constructs, but why does it need to exist at all?
Extra Info:
Per Albert Retey's comment I checked whether either responded differently to upstream changes:
StyleSheetEdit["MyStyle1" -> "Input",
{
InputAliases -> {"0x" -> "\"\[SadSmiley]\"", ParentList}
},
"MakeCell" -> True
];
CellPrint[Cell[BoxData[""], "MyStyle1"]];
StyleSheetEdit["MyStyle2" -> "Input",
{
InputAliases -> {"0x" -> "\"\[SadSmiley]\"", Inherited}
},
"MakeCell" -> True
];
CellPrint[Cell[BoxData[""], "MyStyle2"]];
CurrentValue[EvaluationNotebook[], InputAliases] = {"a" -> "\"b\""};
Both cells behaved entirely the same
Inherited
to reflect those changes but the explicit values thatParentList
was creating would not change. Just guessing... $\endgroup$