3

Quoting https://reference.wolfram.com/language/ref/CellPrint.html

Cells generated by `CellPrint` by default have `GeneratedCell->True`, so that they are overwritten if they are regenerated.

An example from https://reference.wolfram.com/language/ref/Defer.html:

CellPrint[
  Function[{n}, 
    ExpressionCell[Defer[Integrate[x^n Exp[-x], {x, 0, 1}]], "Input"]]
  /@ Range[5]
]

If I put that example code in a new cell in a new notebook and excute it (shift+enter) multiple times, the ouputs are not overwritten. I expected they would be. What am I misunderstanding?

Alan
  • 13,686
  • 19
  • 38
  • The "Input" option seems to override that default. Try http://wolfram.com/xid/0j40bj4y-da8z6e and compare it to the behavior of CellPrint[ExpressionCell[N[Pi, 20]]]. – Karsten7 Oct 16 '15 at 16:42
  • Actually, if one uses Cell ► Show Expression, one can see that in both cases GeneratedCell->True, CellAutoOverwrite->True. – Karsten7 Oct 16 '15 at 16:50
  • Strongly related: http://mathematica.stackexchange.com/q/23149/280 – Alexey Popkov Oct 16 '15 at 19:09

0 Answers0