<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
IN: temporary
+USING: unparser ;
USE: vectors
USE: interpreter
USE: test
[ 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
! 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.
\ 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