16
$\begingroup$

Bug introduced in 10.3 and fixed in 11.0.0


There are couple of issues that are breaking my code after upgrading to 10.3.

I wasn't able to narrow all of them down but this is what I've found. Somethings is going wrong with evaluation:

enter image description here

Let's put TemplateSlot inside TemplateExpression, like above, give to the former a default value and try to generate an example. In 10.2 and 10.3:

enter image description here

gives:

enter image description here

Have I missed something? Which one is expected result? I'd say 10.2 works as expected. Is this the case on Mac and Linux too?


A support case with the identification [CASE:3522351] was created.

$\endgroup$
  • 6
    $\begingroup$ Looks like TemplateExpression is not working right in 10.3 ... Too bad we did not get a chance to beta-test before releasing this version. $\endgroup$ – Rolf Mertig Oct 18 '15 at 9:40
  • $\begingroup$ @Kuba Would you share the official response (three workdays have certainly elapsed...) to the support case -- or at least give the gist of it? $\endgroup$ – gwr Feb 9 '16 at 11:35
  • 1
    $\begingroup$ @gwr Bug is confirmed but the workaround is offtopic in my opinion :) but I will edit it later, maybe I've missed something :) $\endgroup$ – Kuba Feb 9 '16 at 11:36
8
$\begingroup$

There seems to be an incompatible change to NotebookExpression. While I don't quite know how to fix your example, I went ahead and fixed my trouble, i.e. just some input cells which have to be evaluated and hidden. This can be achieved with the following button:

   Button["TemplateExpression Exorcist",
  Module[{cell},
   (* move from inside the cell to the visible cell bracket *)
   Do[SelectionMove[SelectedNotebook[], All, Cell], {10}];
   cell = (NotebookRead[SelectedNotebook[]] /. 
       Cell[BoxData[
          FormBox[TemplateBox[boxes_, 
            "NotebookTemplateExpression"], _]]] :> boxes ) //. 
     BoxData[{b_, "General", BoxData}] :> BoxData[b];
   NotebookWrite[SelectedNotebook[], cell]]] // CreatePalette

So a cell like this one (whichi works in a template in 10.2)

Cell[BoxData[Cell[BoxData[
  FormBox[
   TemplateBox[{RowBox[{
       RowBox[{"myreport", "[", 
         RowBox[{
           Cell[
            BoxData[
             FormBox[
              TemplateBox[{"\"var\"", "\"t0\"", "Named", BoxData}, "NotebookTemplateSlot"], 
              TextForm]]], ",", "\"novar\""}], "]"}], " "}],"General",BoxData},
    "NotebookTemplateExpression"], TextForm]]]], "Input",
 CellFrameLabels->{{
    Cell[
     BoxData[
      TemplateBox[{"EvaluateDeleteInput"}, "NotebookTemplateCellBehavior"]]], None}, {None, None}}]

is change to a working one (in 10.3)

Cell[BoxData[
 RowBox[{
  RowBox[{"myreport", "[", 
   RowBox[{Cell[BoxData[
     FormBox[
      TemplateBox[{"\"var\"","\"t0\"","Named",BoxData},
       "NotebookTemplateSlot"], TextForm]]], ",", "\"\<novar\>\""}], "]"}], " "}]], "Input",
 CellFrameLabels->{{
    Cell[
     BoxData[
      TemplateBox[{"EvaluateDeleteInput"}, "NotebookTemplateCellBehavior"]]], None}, {None, None}}]
$\endgroup$
2
$\begingroup$

This bug was fixed with V11.0.0 release.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.