Yes Sir ! Loving it . That's a primitive yet still good example , thank you .
A more involved "input" for the new menu item to process would be:
NestWhile[
Join @@ Table[
Table[ReplacePart[s, #1 -> n], {n, #2}] & @@
First@SortBy[{#,
Complement[Range@9, s[[First@#]], s[[;; , Last@#]],
Catenate@
Extract[Partition[s, {3, 3}], Quotient[#, 3, -2]]]} & /@
Position[s, 0, {2}],
Length@Last@# &], {s, #}] &, {sudoku}, ! FreeQ[#, 0] &]
That is a nesting of five pure functions. The most basic (and trivial) example would be an algebraic code line:
a + b / c * d ^ e
Selecting this code snippet with my mouse, then right-click context menu item "Show Grouping" should transform/expand the selected code snippet in situ ("in-line") to:
a + ((b / c) * (d ^ e)) (*smart transformation*)
(a + ((b / c) * (d ^ e))) (*brute silly transformation*)
Thus making the code snippet more intelligible and debuggable to the reader, if the code is hard to review or doesn't deliver the desired output. Using FullForm[]
for understanding in-line code or for debugging purposes is not always the way to go, imho.