From tlumley at u.washington.edu  Tue Apr  4 16:21:08 2006
From: tlumley at u.washington.edu (Thomas Lumley)
Date: Tue, 4 Apr 2006 07:21:08 -0700 (PDT)
Subject: [Rd] change function's formals default values
In-Reply-To: <1144114759.15762.3.camel@populus.fr.umn.edu>
References: <1144114759.15762.3.camel@populus.fr.umn.edu>
Message-ID: <Pine.LNX.4.64.0604040714090.26620@homer22.u.washington.edu>

On Mon, 3 Apr 2006, Andrew Finley wrote:

> Hello,
>
> I'm passing a user defined function into my c code. Once this function
> is in my c code, I'd like to iteratively change the values associated
> with the parameters defined in the function's formal list then evaluate
> the function using these newly set defaults (i.e., using lang1(fn)).
>
> My question is, how do I simply change the value associated with each
> parameter in this function's formal list. I have messed around with the
> SET_FORMAL function but can't figure out how to change these values.
>

<recoils in horror>

Are you *sure* you want to do this?  It seems that you should be able to 
use lexical scope to store this information in variables rather than 
default arguments and then you can use setVar to change the variables 
rather than changing the formals.

 	-thomas

Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle



[Rd] change function's formals default values
Thomas Lumley