Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #8383 > unrolled thread

Re: Why does the order of down values come back?

Started byDrMajorBob <btreat1@austin.rr.com>
First post2012-02-07 09:11 +0000
Last post2012-02-07 09:11 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Why does the order of down values come back? DrMajorBob <btreat1@austin.rr.com> - 2012-02-07 09:11 +0000

#8383 — Re: Why does the order of down values come back?

FromDrMajorBob <btreat1@austin.rr.com>
Date2012-02-07 09:11 +0000
SubjectRe: Why does the order of down values come back?
Message-ID<jgqpr5$n2b$1@smc.vnet.net>
More specific patterns always come first.

In your example, especially, it would make NO sense to put them in the  
order you tried.

Bobby

On Mon, 06 Feb 2012 01:38:08 -0600, Shizu <slivo.vitz@msa.hinet.net> wrote:

> In[]:= f[0] := 0;f[1] := 1;f[n_] := f[n - 1] + f[n - 2]
>
> In[]:= DownValues[f]
> Out[]:= {HoldPattern[f[0]] :> 0, HoldPattern[f[1]] :> 1,  
> HoldPattern[f[n_]] :> f[n - 1] + f[n - 2]}
>
> In[]:= DownValues[f] = Reverse[DownValues[f]]
> Out[]:= {HoldPattern[f[n_]] :> f[n - 1] + f[n - 2], HoldPattern[f[1]] :>  
> 1, HoldPattern[f[0]] :> 0}
>
> In[]:= DownValues[f]
> Out[]:= {HoldPattern[f[0]] :> 0, HoldPattern[f[1]] :> 1,  
> HoldPattern[f[n_]] :> f[n - 1] + f[n - 2]}
>
> ====================================================
> My question is:
>
>     Why does the order of down values comes back after reordering?
>
> Thanks.
>


-- 
DrMajorBob@yahoo.com

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web