MathGroup Archive 2010

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

Search the Archive

Re: Sort within self-defined procedure

  • To: mathgroup at smc.vnet.net
  • Subject: [mg108611] Re: Sort within self-defined procedure
  • From: DC <b.gatessucks at gmail.com>
  • Date: Thu, 25 Mar 2010 04:25:20 -0500 (EST)
  • References: <hocm9o$shi$1@smc.vnet.net>

Use := rather than = in your definition.

In[10]:= ks[x_] := Module[{l}, l = {1, 5, x, 2};
   Sort[l, Greater]]

In[12]:= ks[20]

Out[12]= {20, 5, 2, 1}

-Francesco

On 03/24/2010 09:33 AM, dornakul wrote:
> ks[x_] = Module[{l},
>    l = {1, 5, x, 2};
>    Sort[l, Greater]
>    ]


  • Prev by Date: Re: "Quick and dirty" Solve[]
  • Next by Date: Re: estimation
  • Previous by thread: Sort within self-defined procedure
  • Next by thread: Re: Sort within self-defined procedure