MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Mathematica daily WTF (101221T)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg114929] Re: Mathematica daily WTF (101221T)
  • From: Daniel Lichtblau <danl at wolfram.com>
  • Date: Thu, 23 Dec 2010 04:02:40 -0500 (EST)


----- Original Message -----
> From: "kj" <no.email at please.post>
> To: mathgroup at smc.vnet.net
> Sent: Wednesday, December 22, 2010 1:34:25 AM
> Subject: [mg114897] Mathematica daily WTF (101221T)
> Today's daily wonder comes from an innocent attempt to define a
> home-grown version of Sequence:
> 
> In[1]:= sequence /: w_[x___, sequence[y___], z___] := w[x, y, z];
> 
> 
> It seems to work:
> 
> In[2]:= foo[1, 2, sequence[3, 4, 5], 6, 7] ===
> foo[1, 2, Sequence[3, 4, 5], 6, 7]
> 
> Out[2]= True
> 
> 
> But, when evaluated by itself, it causes the Mathematica output
> procedure to spill its guts in a most undignified fashion:
> 
> In[3]:= sequence[3, 4, 5]
> 
> During evaluation of In[3]:= If::argb: If called with 8 arguments;
> between 2 and 4 arguments are expected. >>
> 
> Out[3]= If[False, 3, 4, 5,
> With[{OutputSizeLimit`Dump`boxes$ =
> Block[{$RecursionLimit = Typeset`$RecursionLimit},
> MakeBoxes[sequence[3, 4, 5], StandardForm]]},
> OutputSizeLimit`Dump`loadSizeCountRules[];
> If[TrueQ[BoxForm`SizeCount[OutputSizeLimit`Dump`boxes$, 1048576]],
> OutputSizeLimit`Dump`boxes$,
> OutputSizeLimit`Dump`encapsulateOutput[
> sequence[3, 4, 5], $Line, $SessionID, 5]]], 3, 4, 5]
> 
> 
> Ironically, the idea for trying out this self-rolled implementation
> of sequence as a "universal up-value" comes from a passing remark
> by Robby Villegas in an article (http://is.gd/j8V9f) where he
> introduces such "universal up-values" as an example for why MakeBoxes
> (see Out[3] above) needs to be so "nasty". Point taken, but clearly,
> there's a leak, at least in version 7.
> 
> (I hope that someone at Wolfram is making note of reports like this
> one, since, as far as I can tell, there's no public bug report page
> for Mathematica.)
> 
> ~kj

One can report such things via
http://www.wolfram.com/support/contact/email/?topic=Feedback
They will either determine it is expected behavior (and explain why), or else report it to developers as a potential bug.

I don't know if any WRI employees reading this on MathGroup will treat it as a possible bug and report it as such (I do know that at least one such reader will not). Describing such things on MathGroup has merits in terms of user-community feedback, but it is at best a hit-or-miss method of reporting possible Mathematica bugs to Wolfram Research.

That might be slightly inefficient from the viewpoint of the person reporting, but the two (WRI Technical Support and MathGroup) have very different charters, and different WRI readership as well.

These are general remarks (that is, aimed at the overall MathGroup readership). More specific replies I would ordinarily send just to the original poster simply do not get written, for obvious reasons of addressing.

Daniel Lichtblau
Wolfram Research




  • Prev by Date: Re: what's wrong with this?!!
  • Next by Date: Re: what's wrong with this?!!
  • Previous by thread: Re: Mathematica daily WTF (101221T)
  • Next by thread: Reduce in Mathematica 5 vs Mathematica 8