From db1a69f6aa9cfd185178ad8a661d988160fbf99c Mon Sep 17 00:00:00 2001 From: James Cash Date: Tue, 9 Sep 2008 12:09:23 -0400 Subject: [PATCH 01/18] Adding support for ' quote syntax in lisp.parser --- extra/lisp/parser/parser.factor | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extra/lisp/parser/parser.factor b/extra/lisp/parser/parser.factor index 72344fd0dc..55672af13d 100644 --- a/extra/lisp/parser/parser.factor +++ b/extra/lisp/parser/parser.factor @@ -36,4 +36,6 @@ atom = number | string s-expression = LPAREN (list-item)* RPAREN => [[ second seq>cons ]] list-item = _ ( atom | s-expression ) _ => [[ second ]] -;EBNF +quoted = squote list-item => [[ second nil cons "quote" swap cons ]] +expr = list-item | quoted +;EBNF \ No newline at end of file From 6899bb28989f2cf3080fd25d32044c8fd3b636b4 Mon Sep 17 00:00:00 2001 From: James Cash Date: Tue, 9 Sep 2008 12:25:14 -0400 Subject: [PATCH 02/18] Adding tests for quoted forms in lisp.parser --- extra/lisp/parser/parser-tests.factor | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/extra/lisp/parser/parser-tests.factor b/extra/lisp/parser/parser-tests.factor index d722390f9a..68bda1780a 100644 --- a/extra/lisp/parser/parser-tests.factor +++ b/extra/lisp/parser/parser-tests.factor @@ -65,4 +65,12 @@ IN: lisp.parser.tests } } [ "(1 (3 4) 2)" lisp-expr +] unit-test + +{ { T{ lisp-symbol { name "quote" } } { 1 2 3 } } } [ + "'(1 2 3)" lisp-expr cons>seq +] unit-test + +{ { T{ lisp-symbol f "quote" } T{ lisp-symbol f "foo" } } } [ + "'foo" lisp-expr cons>seq ] unit-test \ No newline at end of file From f82cb061f5127ec319e61980129fa1b1db6145c7 Mon Sep 17 00:00:00 2001 From: James Cash Date: Sun, 14 Sep 2008 20:23:40 -0400 Subject: [PATCH 03/18] Fixing bug with quoted expressions for lisp.parser --- extra/lisp/parser/parser-tests.factor | 4 ++++ extra/lisp/parser/parser.factor | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/extra/lisp/parser/parser-tests.factor b/extra/lisp/parser/parser-tests.factor index 68bda1780a..911a8d3440 100644 --- a/extra/lisp/parser/parser-tests.factor +++ b/extra/lisp/parser/parser-tests.factor @@ -73,4 +73,8 @@ IN: lisp.parser.tests { { T{ lisp-symbol f "quote" } T{ lisp-symbol f "foo" } } } [ "'foo" lisp-expr cons>seq +] unit-test + +{ { 1 2 { T{ lisp-symbol { name "quote" } } { 3 4 } } 5 } } [ + "(1 2 '(3 4) 5)" lisp-expr cons>seq ] unit-test \ No newline at end of file diff --git a/extra/lisp/parser/parser.factor b/extra/lisp/parser/parser.factor index 55672af13d..50f58692d5 100644 --- a/extra/lisp/parser/parser.factor +++ b/extra/lisp/parser/parser.factor @@ -35,7 +35,7 @@ atom = number | identifier | string s-expression = LPAREN (list-item)* RPAREN => [[ second seq>cons ]] -list-item = _ ( atom | s-expression ) _ => [[ second ]] +list-item = _ ( atom | s-expression | quoted ) _ => [[ second ]] quoted = squote list-item => [[ second nil cons "quote" swap cons ]] -expr = list-item | quoted +expr = list-item ;EBNF \ No newline at end of file From d2d3e1e4f24d95d9f8bf6f0fd2e68708a9ed4656 Mon Sep 17 00:00:00 2001 From: James Cash Date: Sun, 14 Sep 2008 20:24:06 -0400 Subject: [PATCH 04/18] Adding more tests to extra/lisp --- extra/lisp/lisp-tests.factor | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/extra/lisp/lisp-tests.factor b/extra/lisp/lisp-tests.factor index 48f6419d30..6e586bc657 100644 --- a/extra/lisp/lisp-tests.factor +++ b/extra/lisp/lisp-tests.factor @@ -84,4 +84,12 @@ IN: lisp.test ] unit-test + { { 3 3 4 } } [ + cons>seq + ] unit-test + ] with-interactive-vocabs From 0e18200b16ea8c1bb1aa234cef3aeb8a5018b193 Mon Sep 17 00:00:00 2001 From: James Cash Date: Sun, 14 Sep 2008 21:28:36 -0400 Subject: [PATCH 05/18] Fixing defun, adding test for it --- extra/lisp/lisp-tests.factor | 5 ++--- extra/lisp/lisp.factor | 21 ++++++++------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/extra/lisp/lisp-tests.factor b/extra/lisp/lisp-tests.factor index 6e586bc657..9ddd31cde0 100644 --- a/extra/lisp/lisp-tests.factor +++ b/extra/lisp/lisp-tests.factor @@ -85,9 +85,8 @@ IN: lisp.test ] unit-test { { 3 3 4 } } [ - cons>seq ] unit-test diff --git a/extra/lisp/lisp.factor b/extra/lisp/lisp.factor index e60529caab..4a933501e8 100644 --- a/extra/lisp/lisp.factor +++ b/extra/lisp/lisp.factor @@ -64,14 +64,9 @@ PRIVATE> : macro-expand ( cons -- quot ) uncons [ list>seq >quotation ] [ lookup-macro ] bi* call call ; - - : expand-macros ( cons -- cons ) - dup list? [ (expand-macros) dup car lisp-macro? [ macro-expand ] when ] when ; - + dup list? [ [ expand-macros ] lmap dup car lisp-macro? [ macro-expand expand-macros ] when ] when ; + : convert-begin ( cons -- quot ) cdr [ convert-form ] [ ] lmap-as [ 1 tail* ] [ but-last ] bi [ '[ { } _ with-datastack drop ] ] map prepend '[ _ [ call ] each ] ; @@ -169,15 +164,15 @@ M: no-such-var summary drop "No such variable" ; "set" "lisp" "define-lisp-var" define-primitive - "(lambda (&rest xs) xs)" lisp-string>factor first "list" lisp-define - "(defmacro setq (var val) (list (quote set) (list (quote quote) var) val))" lisp-eval + "(set 'list (lambda (&rest xs) xs))" lisp-eval + "(defmacro setq (var val) (list 'set (list 'quote var) val))" lisp-eval <" (defmacro defun (name vars &rest body) - (list (quote setq) name (list (quote lambda) vars body))) "> lisp-eval + (list 'setq name (cons 'lambda (cons vars body)))) "> lisp-eval - "(defmacro if (pred tr fl) (list (quote cond) (list pred tr) (list (quote #t) fl)))" lisp-eval + "(defmacro if (pred tr fl) (list 'cond (list pred tr) (list (quote #t) fl)))" lisp-eval ; : " parse-multiline-string define-lisp-builtins - lisp-string>factor parsed \ call parsed ; parsing + "LISP>" parse-multiline-string "(begin " prepend ")" append define-lisp-builtins + lisp-string>factor parsed \ call parsed ; parsing \ No newline at end of file From b250a62f8711c246e88c49db16941be664abf732 Mon Sep 17 00:00:00 2001 From: James Cash Date: Tue, 16 Sep 2008 19:40:30 -0400 Subject: [PATCH 06/18] Fixing spacing --- extra/lisp/lisp-tests.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/lisp/lisp-tests.factor b/extra/lisp/lisp-tests.factor index 9ddd31cde0..5f849c4416 100644 --- a/extra/lisp/lisp-tests.factor +++ b/extra/lisp/lisp-tests.factor @@ -84,7 +84,7 @@ IN: lisp.test ] unit-test - { { 3 3 4 } } [ + { { 3 3 4 } } [ Date: Wed, 22 Oct 2008 23:57:14 -0400 Subject: [PATCH 07/18] Making work director symlink to ~/Programming/factor --- work/README.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 work/README.txt diff --git a/work/README.txt b/work/README.txt deleted file mode 100644 index fd1af07408..0000000000 --- a/work/README.txt +++ /dev/null @@ -1 +0,0 @@ -The 'work' directory is for your own personal vocabularies. From 560399a2b60c96ac5a8d4330c1b4174480d44ded Mon Sep 17 00:00:00 2001 From: James Cash Date: Thu, 30 Oct 2008 20:28:55 -0400 Subject: [PATCH 08/18] Adding some more documentation to extra/lisp --- extra/lisp/lisp-docs.factor | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/extra/lisp/lisp-docs.factor b/extra/lisp/lisp-docs.factor index 149f22864e..a4b0372f16 100644 --- a/extra/lisp/lisp-docs.factor +++ b/extra/lisp/lisp-docs.factor @@ -1,5 +1,12 @@ IN: lisp USING: help.markup help.syntax ; +HELP: into factor quotations and calls it" } +{ $ see-also lisp-string>factor } + +HELP: lisp-string>factor +{ $values { "str" "a string of lisp code" } { "quot" "the quotation the lisp compiles into" } } +{ $description "Turns a string of lisp into a factor quotation" } ARTICLE: "lisp" "Lisp in Factor" "This is a simple implementation of a Lisp dialect, which somewhat resembles Scheme." $nl From f5db48e3b7fbdd5ae5d3148bc2e3541e3ff40e87 Mon Sep 17 00:00:00 2001 From: James Cash Date: Mon, 3 Nov 2008 10:24:13 -0500 Subject: [PATCH 09/18] Fixing typo in lisp-docs --- extra/lisp/lisp-docs.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/lisp/lisp-docs.factor b/extra/lisp/lisp-docs.factor index a4b0372f16..cdeafe3e02 100644 --- a/extra/lisp/lisp-docs.factor +++ b/extra/lisp/lisp-docs.factor @@ -2,7 +2,7 @@ IN: lisp USING: help.markup help.syntax ; HELP: into factor quotations and calls it" } -{ $ see-also lisp-string>factor } +{ $see-also lisp-string>factor } HELP: lisp-string>factor { $values { "str" "a string of lisp code" } { "quot" "the quotation the lisp compiles into" } } From f8da0cd23fd30db2dbd14ed027f3deac02113bf7 Mon Sep 17 00:00:00 2001 From: James Cash Date: Wed, 5 Nov 2008 09:19:59 -0500 Subject: [PATCH 10/18] Starting work on advice vocab --- extra/advice/advice-docs.factor | 0 extra/advice/advice-tests.factor | 5 +++++ extra/advice/advice.factor | 29 +++++++++++++++++++++++++++++ extra/advice/authors.txt | 1 + extra/advice/tags.txt | 3 +++ 5 files changed, 38 insertions(+) create mode 100644 extra/advice/advice-docs.factor create mode 100644 extra/advice/advice-tests.factor create mode 100644 extra/advice/advice.factor create mode 100644 extra/advice/authors.txt create mode 100644 extra/advice/tags.txt diff --git a/extra/advice/advice-docs.factor b/extra/advice/advice-docs.factor new file mode 100644 index 0000000000..e69de29bb2 diff --git a/extra/advice/advice-tests.factor b/extra/advice/advice-tests.factor new file mode 100644 index 0000000000..0d71ef2220 --- /dev/null +++ b/extra/advice/advice-tests.factor @@ -0,0 +1,5 @@ +! Copyright (C) 2008 James Cash +! See http://factorcode.org/license.txt for BSD license. +USING: kernel sequences tools.tests advice ; +IN: advice.tests + diff --git a/extra/advice/advice.factor b/extra/advice/advice.factor new file mode 100644 index 0000000000..12874be1f1 --- /dev/null +++ b/extra/advice/advice.factor @@ -0,0 +1,29 @@ +! Copyright (C) 2008 James Cash +! See http://factorcode.org/license.txt for BSD license. +USING: kernel sequences symbols fry words assocs tools.annotations ; +IN: advice + +SYMBOLS: before after around ; + +: get-advice ( word type -- seq ) + word-prop values ; + +: call-before ( word -- ) + before get-advice [ call ] each ; + +: call-after ( word -- ) + after get-advice [ call ] each ; + +: advise-before ( quot name word -- ) + before word-prop set-at ; + +: advise-after ( quot name word -- ) + after word-prop set-at ; + +: remove-advice ( name word loc -- ) + word-prop delete-at ; + +: make-advised ( word -- ) + [ dup [ over '[ _ call-before @ _ call-after ] ] annotate ] + [ { before after around } [ H{ } clone swap set-word-prop ] with each ] bi ; + \ No newline at end of file diff --git a/extra/advice/authors.txt b/extra/advice/authors.txt new file mode 100644 index 0000000000..4b7af4aac0 --- /dev/null +++ b/extra/advice/authors.txt @@ -0,0 +1 @@ +James Cash diff --git a/extra/advice/tags.txt b/extra/advice/tags.txt new file mode 100644 index 0000000000..a87b65d938 --- /dev/null +++ b/extra/advice/tags.txt @@ -0,0 +1,3 @@ +advice +aspect +annotations From 2904f35f12107dd476e924f71f2eae3658f6555a Mon Sep 17 00:00:00 2001 From: James Cash Date: Wed, 5 Nov 2008 23:49:21 -0500 Subject: [PATCH 11/18] Adding summary for extra/advice --- extra/advice/summary.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 extra/advice/summary.txt diff --git a/extra/advice/summary.txt b/extra/advice/summary.txt new file mode 100644 index 0000000000..a6f9c06526 --- /dev/null +++ b/extra/advice/summary.txt @@ -0,0 +1 @@ +Implmentation of advice/aspects From 585afbf24e329ff7e30b378c10a381cde49f2f6a Mon Sep 17 00:00:00 2001 From: James Cash Date: Wed, 5 Nov 2008 23:49:57 -0500 Subject: [PATCH 12/18] Adding tests for advice --- extra/advice/advice-tests.factor | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/extra/advice/advice-tests.factor b/extra/advice/advice-tests.factor index 0d71ef2220..868f81cbe8 100644 --- a/extra/advice/advice-tests.factor +++ b/extra/advice/advice-tests.factor @@ -1,5 +1,22 @@ ! Copyright (C) 2008 James Cash ! See http://factorcode.org/license.txt for BSD license. -USING: kernel sequences tools.tests advice ; +USING: kernel sequences tools.test advice parser ; IN: advice.tests +[ +: foo "foo" ; +\ foo make-advised + + { "bar" "foo" } [ + [ "bar" ] "barify" \ foo advise-before + foo ] unit-test + + { "bar" "foo" "baz" } [ + [ "baz" ] "bazify" \ foo advise-after + foo ] unit-test + + { "foo" "baz" } [ + "barify" \ foo before remove-advice + foo ] unit-test + + ] with-interactive-vocabs \ No newline at end of file From 0f9ccaa35275c005fcb101612ab93e18a4693809 Mon Sep 17 00:00:00 2001 From: James Cash Date: Wed, 5 Nov 2008 23:50:33 -0500 Subject: [PATCH 13/18] Working on implementation of 'around' advice --- extra/advice/advice.factor | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/extra/advice/advice.factor b/extra/advice/advice.factor index 12874be1f1..3fb6941854 100644 --- a/extra/advice/advice.factor +++ b/extra/advice/advice.factor @@ -1,10 +1,23 @@ ! Copyright (C) 2008 James Cash ! See http://factorcode.org/license.txt for BSD license. -USING: kernel sequences symbols fry words assocs tools.annotations ; +USING: kernel sequences symbols fry words assocs tools.annotations coroutines ; IN: advice SYMBOLS: before after around ; +: advise ( quot name word loc -- ) + word-prop set-at ; + +: advise-before ( quot name word -- ) + before advise ; + +: advise-after ( quot name word -- ) + after advise ; + +: advise-around ( quot name word -- ) + [ \ coterminate suffix cocreate ] 2dip + around advise ; + : get-advice ( word type -- seq ) word-prop values ; @@ -13,17 +26,19 @@ SYMBOLS: before after around ; : call-after ( word -- ) after get-advice [ call ] each ; - -: advise-before ( quot name word -- ) - before word-prop set-at ; - -: advise-after ( quot name word -- ) - after word-prop set-at ; + +: call-around ( main word -- ) + around get-advice [ [ coresume ] each ] dip call + around get-advice reverse [ coresume ] each ; : remove-advice ( name word loc -- ) word-prop delete-at ; + +: ad-do-it ( input -- result ) + coyield ; + : make-advised ( word -- ) - [ dup [ over '[ _ call-before @ _ call-after ] ] annotate ] + [ dup [ over dup '[ _ call-before _ _ call-around _ call-after ] ] annotate ] [ { before after around } [ H{ } clone swap set-word-prop ] with each ] bi ; \ No newline at end of file From 718b29798ab3bca25907f1febef57abb65cfb485 Mon Sep 17 00:00:00 2001 From: James Cash Date: Thu, 6 Nov 2008 00:08:39 -0500 Subject: [PATCH 14/18] Adding missing semicolon to lisp-docs.factor --- extra/lisp/lisp-docs.factor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extra/lisp/lisp-docs.factor b/extra/lisp/lisp-docs.factor index cdeafe3e02..c970a1e0b7 100644 --- a/extra/lisp/lisp-docs.factor +++ b/extra/lisp/lisp-docs.factor @@ -2,11 +2,11 @@ IN: lisp USING: help.markup help.syntax ; HELP: into factor quotations and calls it" } -{ $see-also lisp-string>factor } +{ $see-also lisp-string>factor } ; HELP: lisp-string>factor { $values { "str" "a string of lisp code" } { "quot" "the quotation the lisp compiles into" } } -{ $description "Turns a string of lisp into a factor quotation" } +{ $description "Turns a string of lisp into a factor quotation" } ; ARTICLE: "lisp" "Lisp in Factor" "This is a simple implementation of a Lisp dialect, which somewhat resembles Scheme." $nl From d2224ec9353d25a6c596e4c8afce68de4a9c6bd3 Mon Sep 17 00:00:00 2001 From: James Cash Date: Thu, 6 Nov 2008 00:16:58 -0500 Subject: [PATCH 15/18] Adding documentation for advice --- extra/advice/advice-docs.factor | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/extra/advice/advice-docs.factor b/extra/advice/advice-docs.factor index e69de29bb2..2b33378b99 100644 --- a/extra/advice/advice-docs.factor +++ b/extra/advice/advice-docs.factor @@ -0,0 +1,22 @@ +IN: advice +USING: help.markup help.syntax tools.annotations words ; + +HELP: make-advised +{ $values { "word" "a word to annotate in preparation of advising" } } +{ $description "Prepares a word for being advised. This is done by: " + { $list + { "Annotating it to call the appropriate words before, around, and after the original body " } + { "Adding " { $snippet "before" } ", " { $snippet "around" } ", and " { $snippet "after" } " properties, which will contain the advice" } + { "Adding an " { $snippet "advised" } "property, which can later be used to determine if a given word is defined (see " { $link advised? } ")" } + } +} +{ $see-also advised? annotate } ; + +HELP: advised? +{ $values { "word" "a word" } { "?" "t or f, indicating if " { $snippet word } " is advised" } } +{ $description "Determines whether or not the given word has any advice on it." } ; + +ARTICLE: "advice" "Advice" +"Advice is a simple way of adding additition functionality to words by adding 'hooks' to a word, which can act before, after, or around the calling of the word." ; + +ABOUT: "advice" \ No newline at end of file From d530ec6bd5c2593b84c0b1fa60efd4657e96fdc1 Mon Sep 17 00:00:00 2001 From: James Cash Date: Thu, 6 Nov 2008 00:20:15 -0500 Subject: [PATCH 16/18] More work on around-advice --- extra/advice/advice.factor | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/extra/advice/advice.factor b/extra/advice/advice.factor index 3fb6941854..a71b9590f1 100644 --- a/extra/advice/advice.factor +++ b/extra/advice/advice.factor @@ -3,7 +3,7 @@ USING: kernel sequences symbols fry words assocs tools.annotations coroutines ; IN: advice -SYMBOLS: before after around ; +SYMBOLS: before after around advised ; : advise ( quot name word loc -- ) word-prop set-at ; @@ -28,17 +28,20 @@ SYMBOLS: before after around ; after get-advice [ call ] each ; : call-around ( main word -- ) - around get-advice [ [ coresume ] each ] dip call - around get-advice reverse [ coresume ] each ; + around get-advice tuck + [ [ coresume ] each ] [ call ] [ reverse [ coresume ] each ] tri* ; : remove-advice ( name word loc -- ) word-prop delete-at ; : ad-do-it ( input -- result ) coyield ; - + +: advised? ( word -- ? ) + advised word-prop ; : make-advised ( word -- ) [ dup [ over dup '[ _ call-before _ _ call-around _ call-after ] ] annotate ] - [ { before after around } [ H{ } clone swap set-word-prop ] with each ] bi ; + [ { before after around } [ H{ } clone swap set-word-prop ] with each ] + [ t advised set-word-prop ] tri ; \ No newline at end of file From 894d9a67c9696ef3fd045de1340e14f02b481538 Mon Sep 17 00:00:00 2001 From: James Cash Date: Thu, 6 Nov 2008 00:44:11 -0500 Subject: [PATCH 17/18] Naive around-advice working --- extra/advice/advice.factor | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/extra/advice/advice.factor b/extra/advice/advice.factor index a71b9590f1..6a7d46f935 100644 --- a/extra/advice/advice.factor +++ b/extra/advice/advice.factor @@ -5,8 +5,10 @@ IN: advice SYMBOLS: before after around advised ; + : advise-before ( quot name word -- ) before advise ; @@ -15,7 +17,7 @@ SYMBOLS: before after around advised ; after advise ; : advise-around ( quot name word -- ) - [ \ coterminate suffix cocreate ] 2dip + [ \ coterminate suffix ] 2dip around advise ; : get-advice ( word type -- seq ) @@ -28,7 +30,7 @@ SYMBOLS: before after around advised ; after get-advice [ call ] each ; : call-around ( main word -- ) - around get-advice tuck + around get-advice [ cocreate ] map tuck [ [ coresume ] each ] [ call ] [ reverse [ coresume ] each ] tri* ; : remove-advice ( name word loc -- ) From 6035bb31308b8997dece7ac1002c3be1c3bc91d0 Mon Sep 17 00:00:00 2001 From: James Cash Date: Thu, 6 Nov 2008 00:44:25 -0500 Subject: [PATCH 18/18] Tests of around-advice --- extra/advice/advice-tests.factor | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/extra/advice/advice-tests.factor b/extra/advice/advice-tests.factor index 868f81cbe8..17b60c8fb1 100644 --- a/extra/advice/advice-tests.factor +++ b/extra/advice/advice-tests.factor @@ -1,22 +1,40 @@ ! Copyright (C) 2008 James Cash ! See http://factorcode.org/license.txt for BSD license. -USING: kernel sequences tools.test advice parser ; +USING: kernel sequences math tools.test advice parser namespaces ; IN: advice.tests [ : foo "foo" ; \ foo make-advised - { "bar" "foo" } [ + { "bar" "foo" } [ [ "bar" ] "barify" \ foo advise-before foo ] unit-test - { "bar" "foo" "baz" } [ + { "bar" "foo" "baz" } [ [ "baz" ] "bazify" \ foo advise-after foo ] unit-test - { "foo" "baz" } [ + { "foo" "baz" } [ "barify" \ foo before remove-advice foo ] unit-test - ] with-interactive-vocabs \ No newline at end of file +: bar ( a -- b ) 1+ ; +\ bar make-advised + + { 11 } [ + [ 2 * ] "double" \ bar advise-before + 5 bar + ] unit-test + + { 11/3 } [ + [ 3 / ] "third" \ bar advise-after + 5 bar + ] unit-test + + { -2 } [ + [ -1 * ad-do-it 3 + ] "frobnobicate" \ bar advise-around + 5 bar + ] unit-test + + ] with-scope \ No newline at end of file