comparison testlist.rhope @ 76:004f0fc8941f

Fix list implementation
author Mike Pavone <pavone@retrodev.com>
date Wed, 07 Jul 2010 00:36:59 -0400
parents 0083b2f7b3c7
children
comparison
equal deleted inserted replaced
75:0083b2f7b3c7 76:004f0fc8941f
8 } 8 }
9 } 9 }
10 10
11 Make List Step[list, cur index, curval, num, step:out] 11 Make List Step[list, cur index, curval, num, step:out]
12 { 12 {
13 Print["Make List Step"]
14 { Print[cur index]
15 { Print[curval]
16 {
17 If[[curval]=[num]] 13 If[[curval]=[num]]
18 { out <- list } 14 { out <- list }
19 { 15 {
20 next <- [list]Set[cur index, curval] 16 next <- [list]Set[cur index, curval]
21 Print[[next]Length]
22 {
23 out <- Make List Step[next, [cur index]+[step], [curval]+[1], num, step] 17 out <- Make List Step[next, [cur index]+[step], [curval]+[1], num, step]
24 }
25 } 18 }
26 }}}
27 } 19 }
28 20
29 Sum[list,index,cur:out] 21 Sum[list,index,cur:out]
30 { 22 {
31 [list]Index[index] 23 [list]Index[index]