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
===========================================
- Follow-Ups:
- Re: Returning rules ...
- From: Yasvir Tesiram <Yasvir-Tesiram@omrf.ouhsc.edu>
- Re: Returning rules ...