Differences From Artifact [e50284fdcde212f7]:
- File
sample/type.pmy
- 2010-11-27 23:46:51 - part of checkin [576c494e53] on branch trunk - fixed: literal "..." is now lifted in user-defined layers (user: kinaba) [annotate]
To Artifact [a04d420215bb851f]:
- File
sample/type.pmy
- 2010-11-30 02:21:42 - part of checkin [3fb4d6f9ad] on branch trunk - during @userdefinedlayer function evaluation, if lift(bottom) fails, the recursion is not memoized (user: kinaba) [annotate]
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) ) );