MathGroup Archive 1995

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

Search the Archive

Formating output of Modules

  • Subject: [mg2214] Formating output of Modules
  • From: sherod at boussinesq.Colorado.EDU (Scott Herod)
  • Date: Mon, 16 Oct 1995 15:54:29 GMT
  • Approved: usenet@wri.com
  • Distribution: local
  • Newsgroups: wri.mathgroup
  • Organization: University of Colorado at Boulder
  • Sender: daemon at wri.com ( )

I've got an annoying little problem that I was hoping someone can
help me solve.  I have a Module, NDelaySolve, which returns a
numerical approximation of solutions to differential-delay equations.
In order to make the output look as much like that of NDSolve as
possible, I have the module return something like

{{x[t] -> g[t], y[t] -> f[t]}}

where g[t] and f[t] are often big Which[] functions.  I would like
to reduce the output by creating a DelaySolveFunction[][t] which
looks something like an Interpolating function.

Here is an example:

In[4]:=
  Format[spam[x_]] := 1/x;
In[8]:=
  spam[a_] := Module[{},
    pop = Table[a,{3}]
  ];
In[9]:=
  spam[8]
Out[9]=
  {8, 8, 8}


This Format isn't doing what I want.  I would like spam[8] to return {8,8,8}
but to print the output as 1/8.  If I get this one to work, I could solve
my real problem.

Scott Herod
sherod at newton.colorado.edu


  • Prev by Date: calling external programs from the X-Frontend?
  • Next by Date: Re: Replacing a part of a list/matrix?
  • Previous by thread: calling external programs from the X-Frontend?
  • Next by thread: Formating output of Modules