Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*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

RE: a list as an option

  • To: mathgroup at smc.vnet.net
  • Subject: [mg67208] RE: [mg67150] a list as an option
  • From: "David Park" <djmp at earthlink.net>
  • Date: Sun, 11 Jun 2006 23:08:43 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

You would have to pass the entire list in the option, or have a separate
option for each element.

It might be better to write the definition of your function as

f[a_,b_,c_][variables__]:=....

and then just feed in the particular values you want when you call it. You
could even make a, b and c optional arguments.

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/

From: Akane Tendo [mailto:akane at netvisao.pt]
To: mathgroup at smc.vnet.net


Hello,

If I have a function f with options like:
Options[f]=[...,{pars->{a,b,c}}]
How can I change just one of 'pars' options ('a', 'b' or 'c')?
I tried to change, for example, 'a' to 'd' like this:
SetOptions[f,pars[[1]]->d]
But it didn't work.
I also tried to access the option:
Options[f,pars]
And the result is: {}
Does anyone know what am I doing wrong or if it's not possible at all to
have a list as an option?

Thank you!!




  • Prev by Date: Re: Can Mathematica handle this TeX?
  • Next by Date: Re: a list as an option
  • Previous by thread: Re: a list as an option
  • Next by thread: Re: a list as an option