MathGroup Archive 2007

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

Search the Archive

Re: How to view source code of functions in Mathematica?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg78507] Re: How to view source code of functions in Mathematica?
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Tue, 3 Jul 2007 05:32:18 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <f6amvi$i3m$1@smc.vnet.net>

Budaoy wrote:
> How to view source code of functions in Mathematica? For example, I
> want to view source code of DSolve command which is used to solve a
> differential equation, how can I achieve this? Or all the command
> Mathematica provides are build-in functions? In some other scientific
> softwares I can do this easily.
> 
> Thanks for your reply.

The short answer is that you cannot. Every kernel functions (that is 
functions for which you do not need to load a package before using them) 
are written and compiled in a custom version of C and the source code is 
not provided by Wolfram Research, Inc. (WRI is a commercial company 
which owns the intellectual property of Mathematica, and thereof can 
freely decide whatever license scheme it deems suitable for its business.)

On the other hand, functions that are written in the Mathematica 
programming language are provided in the form of packages. Packages are 
regular text files that, provided they are not encrypted, you can edit 
with any text editor and see the whole Mathematica source code for 
theses functions.If the package is encrypted, well, you cannot see the 
source code in clear.

Now if you want to see what is inside of some package you could have a 
look at, say,

C:\Program Files\Wolfram 
Research\Mathematica\6.0\AddOns\Packages\FourierSeries\FourierSeries.m

(or whatever is suitable to your installation of Mathematica).

Regards,
Jean-Marc


  • Prev by Date: Lynk: a transparent persistence layer for Mathematica
  • Next by Date: Re: Second argument of BeginPackage, revisited
  • Previous by thread: Re: How to view source code of functions in Mathematica?
  • Next by thread: Logics and probability