MathGroup Archive 1999

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

Search the Archive

Re: Defining new Forms


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.?


  • Prev by Date: Re: Re: Re: List-Selection
  • Next by Date: Re: Re: Replacing Part of a Matrix
  • Previous by thread: Defining new Forms
  • Next by thread: 3.0 Front End and 4.0 Kernel