MathGroup Archive 1996

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

Search the Archive

Permanent Module (or Block) values: how?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg3593] Permanent Module (or Block) values: how?
  • From: jchd at worldnet.fr (Jean-Christophe Deschamps)
  • Date: Wed, 27 Mar 1996 03:27:39 -0500
  • Organization: none
  • Sender: owner-wri-mathgroup at wolfram.com

I've been unable to discover the proper way to define permanent
(session-wide) values having Module (or Block) scope.
I do _not_ mean constant (ala With), but variable which should be local to a
single Module, whose last assigned value is remembered for subsequent
invokations of the same Module.

In other words, I'd just love to be able to mimick somehow the class-wide
static variables C++ construct.

Of course, I always can pull off this variable from the said Module and have
the caller module handle it and pass it as a parameter, but this would
violate the desired encapsulation of the implementation.

The only way I see for achieving this is to (temporarily) force
$ModuleNumber to Infinity for this local variable. I haven't tried this yet
and have access to Mma only from time to time.

Did I miss something in the Mma 2.0 book?

Please, e-mail answers as well: my provider only offers RNG (Random News
Group) feed ;-(((
--
 jchd at worldnet.fr          | The number you have reached
                           |    is imaginary !
 voice: (33) 1 42 55 01 93 | Please, rotate your modem 90 degrees,
 fax:   (33) 1 42 52 62 03 |    and try again.

==== [MESSAGE SEPARATOR] ====


  • Prev by Date: Re: addressing matrix elements
  • Next by Date: PlaneCurves website
  • Previous by thread: Re: Nonstandard use of Return[] ??
  • Next by thread: PlaneCurves website