home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / sci / math / symbolic / 2078 < prev    next >
Encoding:
Text File  |  1992-07-26  |  803 b   |  24 lines

  1. Newsgroups: sci.math.symbolic
  2. Path: sparky!uunet!stanford.edu!EE.Stanford.EDU!siegman
  3. From: siegman@EE.Stanford.EDU (Anthony E. Siegman)
  4. Subject: "Subroutines" in Mathematica?
  5. Message-ID: <1992Jul26.175810.15881@EE.Stanford.EDU>
  6. Organization: Stanford University
  7. Date: Sun, 26 Jul 92 17:58:10 GMT
  8. Lines: 14
  9.  
  10. I want to collect a bunch of commands (several pages long) into a
  11. subroutine I can call repeatedly.  I could try a Package of course,
  12. but they're complex and I have only global variables, don't need
  13. context changes or arguments, and just want the simplest solution.  So
  14. far I've been using
  15.  
  16.       mySub = Hold[expr1, expr2, expr3, ...]
  17.  
  18. all in one long cell, then later on
  19.  
  20.       x = 1; a = 3; ... ; ReleaseHold[mySub]
  21.  
  22. to evaluate with global variable values as shown.  Is there a simpler
  23. way?
  24.