A little gift for Joe
parent
dacf1910dc
commit
e8b8b9e446
|
@ -0,0 +1 @@
|
||||||
|
Slava Pestov
|
|
@ -0,0 +1,13 @@
|
||||||
|
IN: method-chains.tests
|
||||||
|
USING: method-chains tools.test arrays strings sequences kernel namespaces ;
|
||||||
|
|
||||||
|
GENERIC: testing ( a b -- c )
|
||||||
|
|
||||||
|
M: sequence testing nip reverse ;
|
||||||
|
AFTER: string testing append ;
|
||||||
|
BEFORE: array testing over prefix "a" set ;
|
||||||
|
|
||||||
|
[ V{ 3 2 1 } ] [ 3 V{ 1 2 3 } testing ] unit-test
|
||||||
|
[ "heyyeh" ] [ 4 "yeh" testing ] unit-test
|
||||||
|
[ { 4 2 0 } ] [ 5 { 0 2 4 } testing ] unit-test
|
||||||
|
[ { 5 0 2 4 } ] [ "a" get ] unit-test
|
|
@ -0,0 +1,7 @@
|
||||||
|
! Copyright (C) 2009 Slava Pestov.
|
||||||
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
|
USING: kernel generic generic.parser words fry ;
|
||||||
|
IN: method-chains
|
||||||
|
|
||||||
|
: AFTER: (M:) dupd '[ [ _ (call-next-method) ] _ bi ] define ; parsing
|
||||||
|
: BEFORE: (M:) over '[ _ [ _ (call-next-method) ] bi ] define ; parsing
|
Loading…
Reference in New Issue