Fix lambda-method forget

db4
Slava Pestov 2008-11-05 18:59:58 -06:00
parent 4fd1767768
commit fbb958da82
2 changed files with 9 additions and 2 deletions

View File

@ -1,7 +1,8 @@
USING: locals math sequences tools.test hashtables words kernel
namespaces arrays strings prettyprint io.streams.string parser
accessors generic eval combinators combinators.short-circuit
combinators.short-circuit.smart math.order math.functions ;
combinators.short-circuit.smart math.order math.functions
definitions compiler.units ;
IN: locals.tests
:: foo ( a b -- a a ) a a ;
@ -378,6 +379,12 @@ M:: sequence method-with-locals ( a -- y ) a reverse ;
[ 9 ] [ 3 big-case-test ] unit-test
GENERIC: lambda-method-forget-test ( a -- b )
M:: integer lambda-method-forget-test ( a -- b ) ;
[ ] [ [ { integer lambda-method-forget-test } forget ] with-compilation-unit ] unit-test
! :: wlet-&&-test ( a -- ? )
! [wlet | is-integer? [ a integer? ]
! is-even? [ a even? ]

View File

@ -450,7 +450,7 @@ M: lambda-method definition
"lambda" word-prop body>> ;
M: lambda-method reset-word
[ f "lambda" set-word-prop ] [ call-next-method ] bi ;
[ call-next-method ] [ f "lambda" set-word-prop ] bi ;
INTERSECTION: lambda-memoized memoized lambda-word ;