MathGroup Archive 2004

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

Search the Archive

Returning rules ...

  • To: mathgroup at
  • Subject: [mg47470] Returning rules ...
  • From: David.Annetts at
  • Date: Tue, 13 Apr 2004 06:26:21 -0400 (EDT)
  • Sender: owner-wri-mathgroup at


We are familiar with functions such as Solve[] that return results as a
series of rules.  My question is how to define a Module that does
essentially the same thing.  For example, I'd like to be able to do 
	test = MyFunction[args];

where MyFunction[args_] := Module[

and have test returned as the list
	test = {
		Value1 -> val1,
		Value2 -> val2, ...}

Can anyone suggest a straightforward means of accomplishing this without
resorting to Global` variables?  Sample code (eg
Statistics`LinearRegression` that returns results in the form I've
described above) has not proved particularly helpful.

Many thanks,

  Dr. David Annetts
  EM Modelling Analyst
  CSIRO DEM            Tel: +612 9490 5416
  North Ryde           Fax: +612 9490 5467
  Australia         David.Annetts at

  • Prev by Date: Re: Complex Numbers
  • Next by Date: Re: NET/Link graphics
  • Previous by thread: Re: Question: ABS and \[Prime]
  • Next by thread: Re: Returning rules ...