]> gitweb.factorcode.org Git - factor.git/commitdiff
Set up listener's manifest so that words defined in "scratchpad" take precedence...
authorSlava Pestov <slava@factorcode.org>
Tue, 3 Jan 2012 05:18:52 +0000 (23:18 -0600)
committerSlava Pestov <slava@factorcode.org>
Tue, 3 Jan 2012 05:18:52 +0000 (23:18 -0600)
basis/listener/listener-tests.factor
basis/listener/listener.factor
core/vocabs/parser/parser.factor

index 907c45360d9ca868c8744e5371aa1e2ad4c965a7..4a97996637831e1efb0efde4f7ff1d33e277b41a 100644 (file)
@@ -1,6 +1,6 @@
 USING: io io.streams.string io.streams.duplex listener
 tools.test parser math namespaces continuations vocabs kernel
-compiler.units eval vocabs.parser ;
+compiler.units eval vocabs.parser words definitions ;
 IN: listener.tests
 
 SYNTAX: hello "Hi" print ;
@@ -52,3 +52,16 @@ SYNTAX: hello "Hi" print ;
         drop
     ] unit-test
 ] with-file-vocabs
+
+[ "call" "scratchpad" create drop ] with-compilation-unit
+
+[
+    [ t ]
+    [
+        "call" "scratchpad" lookup-word
+        [ "call" search ] with-interactive-vocabs
+        eq?
+    ] unit-test 
+] with-file-vocabs
+
+[ "call" "scratchpad" lookup-word forget ] with-compilation-unit
index 740b739c424767085d7ec11278b45086d9bf307b..59ddff1f752e20c57c65a6180e3ec8fcc8d938be 100644 (file)
@@ -185,11 +185,9 @@ SYMBOL: interactive-vocabs
     "vocabs.refresh"
     "vocabs.hierarchy"
     "words"
-    "scratchpad"
 } interactive-vocabs set-global
 
-: only-use-vocabs ( vocabs -- )
-    clear-manifest
+: use-loaded-vocabs ( vocabs -- )
     [ lookup-vocab ] filter
     [
         lookup-vocab
@@ -201,7 +199,7 @@ SYMBOL: interactive-vocabs
 : with-interactive-vocabs ( quot -- )
     [
         "scratchpad" set-current-vocab
-        interactive-vocabs get only-use-vocabs
+        interactive-vocabs get use-loaded-vocabs
         call
     ] with-manifest ; inline
 
index 0259482686c5ceac799ff9930b8a15ceba5f0e59..d0a625b5ae651fa452bd5bbb1e30d0395a8fccd6 100644 (file)
@@ -49,13 +49,6 @@ M: extra-words equal?
 
 C: <extra-words> extra-words
 
-: clear-manifest ( -- )
-    manifest get
-    [ search-vocab-names>> clear-assoc ]
-    [ search-vocabs>> delete-all ]
-    [ qualified-vocabs>> delete-all ]
-    tri ;
-
 ERROR: no-word-in-vocab word vocab ;
 
 <PRIVATE