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


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

C/Fortran-like #include functionality for large expressions?

From Frank Iannarilli <frankeye@cox.net>
Newsgroups comp.soft-sys.math.mathematica
Subject C/Fortran-like #include functionality for large expressions?
Date 2011-12-10 12:29 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jbvjbn$isb$1@smc.vnet.net> (permalink)

Show all headers | View raw


Hi All,


Is there any C #include or similarly Fortran INCLUDE functionality I can gain within Mathematica?  The purpose is to enhance readability of very large function definitions or Manipulate[] invocations, by splicing-in "chunks" of code (expressions) defined in separate cells.

Here's an example of an attempt that doesn't work:

testInclude[] :=
 Module[{a}, a = 2.; ToExpression[p];  Print[a]]

p = "a=3."     // The expression chunk to "include"

testInclude[] 
// would like this to return "3", but stuck returning "2". 

Thanks,
Frank

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


Thread

C/Fortran-like #include functionality for large expressions? Frank Iannarilli <frankeye@cox.net> - 2011-12-10 12:29 +0000
  Re: C/Fortran-like #include functionality for large expressions? David Bailey <dave@removedbailey.co.uk> - 2011-12-11 08:57 +0000
  Re: C/Fortran-like #include functionality for large expressions? "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com> - 2011-12-11 08:46 +0000

csiph-web