# Hold[Dataset[__]] not holding

Bug introduced in 10.0 and fixed in 11.0.0

With

Hold[Dataset[Random[]]]


Hold[Dataset[Random[]]]

Can Dataset expressions be held?

• Related mathematica.stackexchange.com/questions/78131/… and Dataset upvalues but I wasn't able to customize. – Ronald Monson Jul 15 '15 at 2:17
• Current use case is generating some documentation that uses held WL commands but can imagine future needs requiring the passing around of Held Datasets as per the holding of all other WL expressions. – Ronald Monson Jul 15 '15 at 2:46
• Hold stops evaluation, but not typesetting (FormatValues). – ilian Jul 15 '15 at 2:49
• @ilian in terms of evaluation ls = {}; held = Hold@Dataset[AppendTo[ls, Random[]]]; SetAttributes[f, HoldAll]; f[x_] := x; f@held produces three random numbers instead of one random number? in terms of an appearance as a WL command, is there a way of outputting Dataset[{assocs}], verbatim - initial attempts at redefining Dataset output via Format as suggested proved unsuccessful and also seems like overkill ... – Ronald Monson Jul 15 '15 at 3:41
• Yes, it looks like there is an evaluation leak in the typesetting. Note that FullForm[f @ held] is as expected. Would perhaps something like Inactivate[Dataset[{Random[], Random[]}], Random] work? – ilian Jul 15 '15 at 4:13

This question is related to:

My proposed solution:

mk : MakeBoxes[(Hold | HoldForm | HoldComplete | HoldPattern)[__], _] :=
Block[{$hldDataset = True, Dataset}, mk] /; ! TrueQ[$hldDataset]


Now:

Hold[Dataset[Random[]]]

Hold[Dataset[Random[]]]


Unlike the case of Graphics I consider the default formatting behavior pathological here.

• Very neat. Thanks. Did the trick and helps improve said documentation. – Ronald Monson Jul 15 '15 at 6:54
• Yes, definitely a bug, which has since been fixed. – Itai Seggev Apr 22 '17 at 0:19
• @ItaiSeggev Thank you. Do you know the specific version in which the bug was corrected? – Mr.Wizard Apr 22 '17 at 0:23
• Fixed in 11.0.0. See also (89036). – ilian Apr 22 '17 at 16:38