Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #9963

Question about Initialization Cells

From James Stein <james@stein.org>
Newsgroups comp.soft-sys.math.mathematica
Subject Question about Initialization Cells
Date 2012-05-05 08:16 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jo2nke$mdk$1@smc.vnet.net> (permalink)

Show all headers | View raw


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?

Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Question about Initialization Cells James Stein <james@stein.org> - 2012-05-05 08:16 +0000
  Re: Question about Initialization Cells David Reiss <dbreiss@gmail.com> - 2012-05-08 08:07 +0000
  Re: Question about Initialization Cells Murray Eisenberg <murray@math.umass.edu> - 2012-05-09 07:52 +0000

csiph-web