]> gitweb.factorcode.org Git - factor.git/commitdiff
fix namespace bug in meta-interpreter
authorSlava Pestov <slava@factorcode.org>
Mon, 13 Jun 2005 01:52:36 +0000 (01:52 +0000)
committerSlava Pestov <slava@factorcode.org>
Mon, 13 Jun 2005 01:52:36 +0000 (01:52 +0000)
TODO.FACTOR.txt
library/test/interpreter.factor
library/tools/interpreter.factor

index af3e9616bf66fc731ad0bc94be2741cfed66d828..5f6f3e5cceb3682080966696670379789c3ac380 100644 (file)
@@ -7,7 +7,6 @@
 <magnus--> http://clozure.com/cgi-bin/viewcvs.cgi/ccl/lisp-kernel/lisp-exceptions.c?rev=1.9&content-type=text/vnd.viewcvs-markup\r
 \r
 <erg> if write returns -1  and errno == EINTR then it's not a real error, you can try again\r
-- single-stepper and variable access: wrong namespace?\r
 - http keep alive, and range get\r
 - sleep word\r
 - fix i/o on generic x86/ppc unix\r
index ff82cf419e5236a5a72cd925ffaac0386352ab2a..c0e8ba49cd9674480a31b7d56bd8b7b5881fe8ea 100644 (file)
@@ -1,4 +1,5 @@
 IN: temporary
+USING: unparser ;
 USE: vectors
 USE: interpreter
 USE: test
@@ -63,6 +64,26 @@ USE: sequences
     [ 2 2 + ] test-interpreter
 ] unit-test
 
+[ { 3 } ] [
+    [ 3 "x" set "x" get ] test-interpreter
+] unit-test
+
+[ { } ] [
+    [ 2 2 + . ] test-interpreter
+] unit-test
+
+[ { "hi\n" } ] [
+    [ [ "hi" print ] with-string ] test-interpreter
+] unit-test
+
+[ { "4\n" } ] [
+    [ [ 2 2 + unparse print ] with-string ] test-interpreter
+] unit-test
+
+[ { "4" } ] [
+    [ [ 0 2 2 + prettyprint* drop ] with-string ] test-interpreter
+] unit-test
+
 [ { "4\n" } ] [
     [ [ 2 2 + . ] with-string ] test-interpreter
 ] unit-test
index 30443ef8c74d9f91dba37e9b346ce4d51f9d030e..f61b01fba3aed2a57c56d521e0971b28d1e8e1f5 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2004, 2005 Slava Pestov.
 ! See http://factor.sf.net/license.txt for BSD license.
 IN: interpreter
-USING: errors kernel lists math namespaces prettyprint sequences
-stdio strings vectors words ;
+USING: errors kernel kernel-internals lists math namespaces
+prettyprint sequences stdio strings vectors words ;
 
 ! A Factor interpreter written in Factor. Used by compiler for
 ! partial evaluation, also by the walker.
@@ -93,5 +93,6 @@ SYMBOL: meta-executing
 \ call [ pop-d meta-call ] set-meta-word
 \ execute [ pop-d meta-word ] set-meta-word
 \ ifte [ pop-d pop-d pop-d [ nip ] [ drop ] ifte meta-call ] set-meta-word
+\ dispatch [ pop-d pop-d swap nth meta-call ] set-meta-word
 
 \ set-meta-word forget