Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Question about Initialization Cells
Replies: 4   Last Post: May 9, 2012 3:52 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
James Stein

Posts: 12
Registered: 8/12/10
Question about Initialization Cells
Posted: May 5, 2012 4:16 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


I downloaded the source code for a Wolfram Demonstrations Project; this one:
http://demonstrations.wolfram.com/ComparingAlgorithmsForTheTravelingSalesmanProblem/

The first three cells, all initialization cells, each contain a simple
one-liner, for example:
dist[p1_, p2_] := Norm[p1 - p2]
When I evaluate any of these cells, it appears to define the function, but
when I try (in a second, new notebook window) to evaluate the function
(e.g., to evaluate "dist[4.5]}), the function is undefined. It is blue i
the second window, even though it is black in the first window.

But If I type "dist[4,5]" in the demonstration project window itself, all
works as expected.

The demo project does not appear to be a package; 'dist' does not seem to
be private. What am I missing?




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.