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 *)