Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

internal details of Options, Default, Attributes

  • To: mathgroup at smc.vnet.net
  • Subject: [mg96374] internal details of Options, Default, Attributes
  • From: obott0 at gmail.com
  • Date: Thu, 12 Feb 2009 06:39:36 -0500 (EST)

Are DefaultValues of variables basically like UpValues but restricted
to the Default and Options functions?

In[1]:= DefaultValues[LinearSolve]
Out[1]= {HoldPattern[Options[LinearSolve]] :> {Method -> Automatic,
Modulus -> 0, ZeroTest -> Automatic}}

If this is how it works, does Attributes work in the same way? In
other words, is there some function I can call with Plus that will
return something like:

In[1]:= SomeFunction[Plus]
Out[1]= {HoldPattern[Attributes[Plus]] :> {Flat, Listable,
NumericFunction, OneIdentity, Orderless, Protected}}
---------------------------

I tried setting an upvalue for a built-in function with Options, but
noticed that it only changed the DefaultValues of the function:

Options[LinearSolve] ^= {Method -> Automatic, Modulus -> 3, ZeroTest -
> Automatic}
(* this did not set an upvalue for LinearSolve *)



  • Prev by Date: Scalar plot in 3D
  • Next by Date: Re: switching axes in Plot?
  • Previous by thread: Re: Re: Re: Scalar plot in 3D
  • Next by thread: Problem Solved! - FW: Reposted, Reformatted Re: "mapping" functions over lists, again