MathGroup Archive 2004

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

Search the Archive

Re: Returning rules ...

  • To: mathgroup at smc.vnet.net
  • Subject: [mg47481] Re: Returning rules ...
  • From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig-de>
  • Date: Wed, 14 Apr 2004 07:16:29 -0400 (EDT)
  • Organization: Uni Leipzig
  • References: <c5ggdm$aut$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

something like:

MyFunction[arg_,{v1_,v2_}]:=
  Module[{res},
  res={1,2};
 {v1,v2}->res //Thread
]

Regards
  Jens

<David.Annetts at csiro.au> schrieb im Newsbeitrag
news:c5ggdm$aut$1 at smc.vnet.net...
> 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: Regarding a 3D plot in mathematica
  • Next by Date: Re: Partitioning a list into unequal partitions
  • Previous by thread: Re: Returning rules ...
  • Next by thread: DirectMath experience