Differences From Artifact [683a8d961c6525cd]:
- File
sample/pattern.pmy
- 2010-11-21 14:24:33 - part of checkin [3995a5eb6a] on branch trunk - added iikagen pattern match (user: kinaba) [annotate]
To Artifact [3044d19024152b10]:
- File
sample/pattern.pmy
- 2010-11-21 15:48:16 - part of checkin [f86026acb8] on branch trunk - macro cache and automemoization reloaded. auto re-run implemented. but automemo and autorerun is currently disabled. we need Table.opCmp... we also need to think more about the memoization (user: kinaba) [annotate]
15 { 15 {
16 case( lst ) 16 case( lst )
17 when( {car:x, cdr:{car: y, cdr:z}} ) { {car: x+y, cdr: adjSum(z)} } 17 when( {car:x, cdr:{car: y, cdr:z}} ) { {car: x+y, cdr: adjSum(z)} }
18 when( {car:x, cdr:{}} ) { {car: x, cdr: {}} } 18 when( {car:x, cdr:{}} ) { {car: x, cdr: {}} }
19 when( {} ) { {} } 19 when( {} ) { {} }
20 }; 20 };
21 21
22 var xs = fromTo(1,11); | 22 var xs = fromTo(1,101);
23 23
24 print( xs ); 24 print( xs );
25 print( length(xs) ); 25 print( length(xs) );
26 print( adjSum(xs) ); 26 print( adjSum(xs) );
27 print( length(adjSum(xs)) ); 27 print( length(adjSum(xs)) );