Paste: Failing advice test

Author: jamesnvc
Mode: factor
Date: Tue, 11 Nov 2008 07:25:36
Plain Text |
    : add ( a b -- c ) + ;
    \ add make-advised

    { 10 } [
        [ [ 2 * ] bi@ ] "double-args" \ add advise-before
        2 3 add
    ] unit-test 

    { 21 } [
        [ 3 * ad-do-it 1- ] "around1" \ add advise-around
        2 3 add
    ] unit-test 

    { 9 } [
        [ [ 1- ] bi@ ad-do-it 2 / ] "around2" \ add advise-around
        2 3 add
    ] unit-test ! Should give 9, but fails with 9+1/2

New Annotation

Summary:
Author:
Mode:
Body: