Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

function's local constants interdependence

  • To: mathgroup at
  • Subject: [mg69612] function's local constants interdependence
  • From: "rych" <rychphd at>
  • Date: Sun, 17 Sep 2006 06:58:08 -0400 (EDT)

Could someone please help me find a decent way to have local constants
defined using one another in order?
Simple "With[" doesn't work:

ff[x_,y_]:=With[{a=x, b=2*a},{a,b}]
> {x,2 a}

where I'd like it be >{x, 2 x}. I suspect it would work with "Module["
but I especially wanted them to be constants.

Do I have to nest With[ ? Or is there a prettier way?

  • Prev by Date: Re: Variables Within Homemade Functions
  • Next by Date: RE: Variables Within Homemade Functions
  • Previous by thread: Re:
  • Next by thread: Re: function's local constants interdependence