Re: How to get non-printing heads?
- To: mathgroup at smc.vnet.net
- Subject: [mg46998] Re: How to get non-printing heads?
- From: "Peter Pein" <no at spam.no>
- Date: Fri, 19 Mar 2004 01:35:51 -0500 (EST)
- References: <firstname.lastname@example.org>
- Sender: owner-wri-mathgroup at wolfram.com
"kj" <socyl at 987jk.com> schrieb im Newsbeitrag news:c388k0$bnb$1 at smc.vnet.net... > > How can I give a Mathematica object a different head? > > I tried > > In:= Head[a] ^= Constant; > > But, as shown below, this doesn't work as desired: > > In:= MatchQ[a, _Constant] > > Out= False .... In:= a = Constant["a"]; a^2 + b^2 Out= b^2 + Constant[a]^2 In:= Unprotect[Constant]; Format[Constant[x_String]] ^= x; Protect[Constant]; a^2 + b^2 Out= b^2 + a^2 In:= Head[a] Out= Constant might do what you want -- Peter Pein, Berlin petsie at arcAND.de replace && by || to write to me