Re: Defining new Forms
- To: mathgroup at smc.vnet.net
- Subject: [mg20305] Re: Defining new Forms
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Fri, 15 Oct 1999 20:20:38 -0400
- Organization: Universitaet Leipzig
- References: <7tuos0$ehq@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi Eckhard,
whats wrong with FullForm[] and First[] ?
The general rule in Matheamtica is that
- if someone really want to see the internal data representation
he has to use FullForm[]
It is not clear why you introduce the ListForm[]. Since Mathematica has
no ListForm[] primitive it will ignore Format[_,ListForm] statements.
If you realy need the first argument of your LargeObject[] you can
simply
call First[LargeObject[_,_]]. This is the typical way to acess the data
in
Graphics[] objects ..
So you can use
obj // First
and get what you want without any additional formats.
Hope that helps
Jens
Eckhard Hennig wrote:
>
> Hi, I would greatly appreciate some help on the following problem with
> Mathematica 3.0's expression formatting functionality. Assume that we have
> objects of the form
>
> LargeObject[lst, stuff]
>
SNIPP SNAPP
> So far, no problem. Now, I also want to be able to display a LargeObject
> such that the user data "lst" is shown in its natural form, i.e. as a list
> in StandardForm(!), using a new format type "ListForm" as illustrated below.
>
> In[2]:= obj // ListForm
>
> Out[2]//ListForm= {1, 2, 3, 4, 5}
>
> Although I experimented a lot with formatting rules, I was not able to
> produce exactly what I want. The definition
>
> Format[ListForm[LargeObject[a_,b_]]] := a
>
> returns the list but without the //ListForm suffix in the cell label,
> whereas the definition
>
SNIP SNAP
> Does anyone have an idea how to apply Format and/or MakeBoxes to make the
> command
>
> obj // ListForm
>
> produce the correct output in StandardForm involving RowBoxes etc.?