MathGroup Archive 2005

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

Search the Archive

Re: UpSetDelayed and N

  • To: mathgroup at smc.vnet.net
  • Subject: [mg57138] Re: [mg57128] UpSetDelayed and N
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Tue, 17 May 2005 01:20:01 -0400 (EDT)
  • References: <200505170135.VAA23186@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

On 17 May 2005, at 10:35, François Wirion wrote:

> Hello,
>
> I have done the following in Mathematica:
> P[N[x]] ^:= 0
> If I put in
> P[N[x]]
> it returns
> 0
> as expected.
>
> However, I haven't been able to find where this definition is stored.
> Calling the following for P
>
> OwnValues[P]
> DownValues[P]
> UpValues[P]
> SubValues[P]
> NValues[P]
> DefaultValues[P]
> FormatValues[P]
> Messages[P]
>
> and N
>
> OwnValues[N]
> DownValues[N]
> UpValues[N]
> SubValues[N]
> NValues[N]
> DefaultValues[N]
> FormatValues[N]
> Messages[N]
>
> returns mostly empty lists, but no definition that says that P[N[x]] is
> 0. Where then would this be stored?
>
> Thank you for any help or advice,
>
> François Wirion


It is stored as an Upvalue of x.

P[N[x]] ^:= 0


UpValues[x]


{HoldPattern[P(x)]:>0}

The reason is of course that N[x]  returns x.

Andrzej Kozlowski


  • Prev by Date: Re: UpSetDelayed and N
  • Next by Date: How to get an answer as a Root object?
  • Previous by thread: Re: UpSetDelayed and N
  • Next by thread: Re: UpSetDelayed and N