MathGroup Archive 2005

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

Search the Archive

Re: Types in Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg62695] Re: Types in Mathematica
  • From: Bill Rowe <readnewsciv at earthlink.net>
  • Date: Wed, 30 Nov 2005 22:09:24 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

On 11/30/05 at 12:06 AM, hattons at globalsymmetry.com (Steven T.
Hatton) wrote:

>I am inclined to think of type systems in other programming
>languages as a means of communicating to both the compiler, and the
>human reader of a program the intent of the programmer.  In a
>strongly typed language, it is often possible to leverage function
>signatures, and return value types as a means of creating skeleton
>documentation.  Often such skeleton documentation is sufficient for
>presenting the API to a programmer without any additional "human"
>contribution. 

In fact, I use something along those lines in packages I've written form myself. For example I might have a function written as func[x_Real, y_Integer]:= ... In this case, I write the usage message as Usage::func = "func[x_Real, y_Integer] ... returns ..." which allows me to quickly see at a much later time what I had in mind when I created the function.

>Information[] doesn't actually provide that hyperlink, but ? and ??
>will.

You are correct. I was a bit sloppy. I seldom use Information directly preferring the shortcut ? and forgot the hyperlink only shows up in that case.

>Nonetheless, the additional documentation does not provide a
>more detailed "type" specification than does Information[].  At
>least not in the case of Plot3D.  

I really don't understand your complaint here. When I do ?Plot3D I get a hyperlink to fuller doumentation. And at the bottom the following appears

 Plot3D includes a setting for the MeshRange option in the SurfaceGraphics object it returns. 
 
That pretty clearly indicates a return type. Futher there is a hyperlink below for Graphics3D which in turn has a hyperlink to SurfaceGraphics. Or you could start typing SurfaceGraphics into the search box at the top to go more directly to documentation for SurfaceGraphics.

If your complaint is there isn't a nice concise summary of return types along the lines I've seen for C documentation, then yes I agree the documentation could be seen as lacking. In fact, I would not suggest the documentation for Mathematica is ideal or could not be improved.
--
To reply via email subtract one hundred and four


  • Prev by Date: Re: FindMinimum is not obeying my bounds
  • Next by Date: Re: Importing tab-delimited data files?
  • Previous by thread: Re: Types in Mathematica
  • Next by thread: Re: Re: Types in Mathematica