Fix lambda-method forget
parent
4fd1767768
commit
fbb958da82
|
@ -1,7 +1,8 @@
|
||||||
USING: locals math sequences tools.test hashtables words kernel
|
USING: locals math sequences tools.test hashtables words kernel
|
||||||
namespaces arrays strings prettyprint io.streams.string parser
|
namespaces arrays strings prettyprint io.streams.string parser
|
||||||
accessors generic eval combinators combinators.short-circuit
|
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
|
IN: locals.tests
|
||||||
|
|
||||||
:: foo ( a b -- a a ) a a ;
|
:: 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
|
[ 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-&&-test ( a -- ? )
|
||||||
! [wlet | is-integer? [ a integer? ]
|
! [wlet | is-integer? [ a integer? ]
|
||||||
! is-even? [ a even? ]
|
! is-even? [ a even? ]
|
||||||
|
|
|
@ -450,7 +450,7 @@ M: lambda-method definition
|
||||||
"lambda" word-prop body>> ;
|
"lambda" word-prop body>> ;
|
||||||
|
|
||||||
M: lambda-method reset-word
|
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 ;
|
INTERSECTION: lambda-memoized memoized lambda-word ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue