Re: locally changing Options
- To: mathgroup at smc.vnet.net
- Subject: [mg108282] Re: locally changing Options
- From: Raffy <adraffy at gmail.com>
- Date: Fri, 12 Mar 2010 07:12:37 -0500 (EST)
- References: <hnakgk$5oa$1@smc.vnet.net>
On Mar 11, 3:34 am, hemmecke <hemme... at gmail.com> wrote:
> In a function I'd like to temporarily say
>
> foo[x_]:=Module[{...},
> ...
> SetOptions[RowReduce, Method->OneStepRowReduction];
> ...
> ]
>
> without affecting the global setting for RowReduce when I call foo.
>
> My experiments wrapping the SetOptions with a Block structure were not
> fruitful so far.
> The only thing I can think of is something of the form
>
> method = Options[RowReduce, Method];
> SetOptions[RowReduce, Method->OneStepRowReduction];
> ... do something ...
> SetOptions[RowReduce,method]
>
> But that looks ugly.
>
> Any suggestions with built-in Mathematica features to achieve this kind o=
f
> locality.
>
> Ralf
Block[
{RowReduce = RowReduce[#1, Method -> "OneStepRowReduction", ##2] &},
(* your code here *)
]
- Follow-Ups:
- Re: Re: locally changing Options
- From: DrMajorBob <btreat1@austin.rr.com>
- Re: Re: locally changing Options
- From: Leonid Shifrin <lshifr@gmail.com>
- Re: Re: locally changing Options