MathGroup Archive 2004

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

Search the Archive

Returning rules ...

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

Hi,

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[
	{},
	...
	Return[{...}];
	];,

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,

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


  • 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 ...