Overview
SHA1 Hash: | 3fb4d6f9ad513b3d547870d8ea5b5027befba309 |
---|---|
Date: | 2010-11-30 11:21:42 |
User: | kinaba |
Comment: | during @userdefinedlayer function evaluation, if lift(bottom) fails, the recursion is not memoized |
Timelines: | family | ancestors | descendants | both | trunk |
Downloads: | Tarball | ZIP archive |
Other Links: | files | file ages | manifest |
Tags And Properties
- branch=trunk inherited from [f65680e1d2]
- sym-trunk inherited from [f65680e1d2]
Changes
Modified polemy/eval.d from [969111acf2042a22] to [f4751e4eb7df513a].
417 { 417 { 418 if( ++(*p)[1] >= 2 ) // [TODO] is 2 real 418 if( ++(*p)[1] >= 2 ) // [TODO] is 2 real 419 return (*p)[0]; 419 return (*p)[0]; 420 } 420 } 421 else 421 else 422 { 422 { 423 Value v; 423 Value v; 424 try { v = evlay.lift(new BottomValue, ct | 424 try { v = evlay.lift(new BottomValue, ct 425 memo[memokey] = tuple(v, 0); 425 memo[memokey] = tuple(v, 0); 426 } 426 } 427 427 428 Value r = nonMemoizedRun(); 428 Value r = nonMemoizedRun(); 429 memo[memokey] = tuple(r, 9999); 429 memo[memokey] = tuple(r, 9999); 430 return r; 430 return r; 431 } 431 }
Modified polemy/lex.d from [b98d4e6a5ceb6fb9] to [8d68dafbd094d6fe].
33 assert_eq( t, new Token(p, "class", false) ); 33 assert_eq( t, new Token(p, "class", false) ); 34 assert_lt( t, new Token(p, "struct", false) ); 34 assert_lt( t, new Token(p, "struct", false) ); 35 assert_ne( t, u ); 35 assert_ne( t, u ); 36 assert( u.quoted ); 36 assert( u.quoted ); 37 37 38 assert( !__traits(compiles, new Token) ); 38 assert( !__traits(compiles, new Token) ); 39 assert( !__traits(compiles, t.pos=p) ); 39 assert( !__traits(compiles, t.pos=p) ); 40 assert( !__traits(compiles, t.str=789) ); | 40 assert( !__traits(compiles, t.str="789") ); 41 assert( !__traits(compiles, t.quoted=true) ); 41 assert( !__traits(compiles, t.quoted=true) ); 42 } 42 } 43 43 44 /// Named Construtors for Lexer 44 /// Named Construtors for Lexer 45 45 46 Lexer lexerFromFile(T...)( string filename, T ln_cn ) 46 Lexer lexerFromFile(T...)( string filename, T ln_cn ) 47 { 47 {
Modified sample/type.pmy from [e50284fdcde212f7] to [a04d420215bb851f].
163 def revi(xs, ys) { 163 def revi(xs, ys) { 164 case xs 164 case xs 165 when {car: x, cdr: xs}: revi(xs, cons(x,ys)) 165 when {car: x, cdr: xs}: revi(xs, cons(x,ys)) 166 when {}: ys 166 when {}: ys 167 }; 167 }; 168 revi(xs, {}) 168 revi(xs, {}) 169 }; 169 }; > 170 > 171 def str_app(xs, ys) { > 172 case xs > 173 when {car: x, cdr: xs}: cons(""~x, str_app(xs, ys)) > 174 when {}: ys > 175 }; 170 176 171 var xs = cons(1, cons(2, cons(3, nil))); 177 var xs = cons(1, cons(2, cons(3, nil))); > 178 var ys = cons("four", cons("five", cons("six", nil))); 172 print( @type( rev(xs) ) ); 179 print( @type( rev(xs) ) ); > 180 print( @type( rev(ys) ) ); > 181 print( @type( str_app(xs,ys) ) ); > 182 print( @type( str_app(xs,xs) ) );