MathGroup Archive 2011

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

Search the Archive

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

  • To: mathgroup at smc.vnet.net
  • Subject: [mg123517] C/Fortran-like #include functionality for large expressions?
  • From: Frank Iannarilli <frankeye at cox.net>
  • Date: Sat, 10 Dec 2011 07:26:54 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Reply-to: comp.soft-sys.math.mathematica at googlegroups.com

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




  • Prev by Date: Re: NDSolve[]
  • Next by Date: Function for complex polynomial with variable number of arguments
  • Previous by thread: Re: Cdf files info
  • Next by thread: Re: C/Fortran-like #include functionality for large expressions?