Check-in [3fb4d6f9ad]
Not logged in
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
Changes

Modified polemy/eval.d from [969111acf2042a22] to [f4751e4eb7df513a].

417 417 { 418 418 if( ++(*p)[1] >= 2 ) // [TODO] is 2 really enough?? 419 419 return (*p)[0]; 420 420 } 421 421 else 422 422 { 423 423 Value v; 424 - try { v = evlay.lift(new BottomValue, ctx, pos); } catch { v = new BottomValue; } 424 + try { v = evlay.lift(new BottomValue, ctx, pos); } catch { return nonMemoizedRun(); } 425 425 memo[memokey] = tuple(v, 0); 426 426 } 427 427 428 428 Value r = nonMemoizedRun(); 429 429 memo[memokey] = tuple(r, 9999); 430 430 return r; 431 431 }

Modified polemy/lex.d from [b98d4e6a5ceb6fb9] to [8d68dafbd094d6fe].

33 33 assert_eq( t, new Token(p, "class", false) ); 34 34 assert_lt( t, new Token(p, "struct", false) ); 35 35 assert_ne( t, u ); 36 36 assert( u.quoted ); 37 37 38 38 assert( !__traits(compiles, new Token) ); 39 39 assert( !__traits(compiles, t.pos=p) ); 40 - assert( !__traits(compiles, t.str=789) ); 40 + assert( !__traits(compiles, t.str="789") ); 41 41 assert( !__traits(compiles, t.quoted=true) ); 42 42 } 43 43 44 44 /// Named Construtors for Lexer 45 45 46 46 Lexer lexerFromFile(T...)( string filename, T ln_cn ) 47 47 {

Modified sample/type.pmy from [e50284fdcde212f7] to [a04d420215bb851f].

163 163 def revi(xs, ys) { 164 164 case xs 165 165 when {car: x, cdr: xs}: revi(xs, cons(x,ys)) 166 166 when {}: ys 167 167 }; 168 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 177 var xs = cons(1, cons(2, cons(3, nil))); 178 +var ys = cons("four", cons("five", cons("six", nil))); 172 179 print( @type( rev(xs) ) ); 180 +print( @type( rev(ys) ) ); 181 +print( @type( str_app(xs,ys) ) ); 182 +print( @type( str_app(xs,xs) ) );