Re: something nice I found today, return multiple values from a function
- To: mathgroup at smc.vnet.net
- Subject: [mg113111] Re: something nice I found today, return multiple values from a function
- From: "Ingolf Dahl" <ingolf.dahl at telia.com>
- Date: Wed, 13 Oct 2010 12:39:34 -0400 (EDT)
- References: <201010121751.NAA03605@smc.vnet.net>
- Reply-to: <ingolf.dahl at telia.com>
You might use just getPointCoordinates[x_, y_] := {x -> 10, y -> 7} without Module. Module is superfluous without variables. If you need some parentheses for multiple expressions, you might use ordinary ( ) Best regards Ingolf Dahl > -----Original Message----- > From: Nasser M. Abbasi [mailto:nma at 12000.org] > Sent: den 12 oktober 2010 19:52 > To: mathgroup at smc.vnet.net > Subject: [mg113095] Re: something nice I found today, return multiple values from a > function > > On 10/12/2010 3:52 AM, Nasser M. Abbasi wrote: > > > > > -------------------- > > getPointCoordinates[] := Module[{x,y}, {x -> 10, y -> 7}] > > > > p = getPointCoordinates[]; > > x = x /. data; > > y = y /. data; > > > > Print["x=", x] > > Print["y=", y] > > > > x=10 > > y=7 > > --------------------- > > > > Opps, I was in middle of editing and pasted earlier version, here is the > final version: > > ------------------ > getPointCoordinates[x_, y_] := Module[{}, {x -> 10, y -> 7}] > > p = getPointCoordinates[x, y]; > x = x /. p; > y = y /. p; > > Print["x=", x] > Print["y=", y] > > x=10 > y=7 > > -------------------- > > --Nasser
- References:
- Re: something nice I found today, return multiple values from a function
- From: "Nasser M. Abbasi" <nma@12000.org>
- Re: something nice I found today, return multiple values from a function