]> gitweb.factorcode.org Git - factor.git/commitdiff
compiler work, file-responder fix
authorSlava Pestov <slava@factorcode.org>
Tue, 5 Oct 2004 01:51:57 +0000 (01:51 +0000)
committerSlava Pestov <slava@factorcode.org>
Tue, 5 Oct 2004 01:51:57 +0000 (01:51 +0000)
library/compiler/compiler.factor
library/httpd/file-responder.factor
library/httpd/html.factor
library/interpreter.factor

index 641fe58fac5f8f5534f4ecb0b2959d3fcbad5174..ca3b8c4a61faa967077a4d621e18329cedec722b 100644 (file)
@@ -58,16 +58,19 @@ SYMBOL: compiled-xts
     cell compile-aligned
     compiled-offset swap compiled-xts acons@ ;
 
+: commit-xt ( xt word -- )
+    t over "compiled" set-word-property  set-word-xt ;
+
 : commit-xts ( -- )
-    compiled-xts get [ unswons set-word-xt ] each
+    compiled-xts get [ unswons commit-xt ] each
     compiled-xts off ;
 
 : compiled-xt ( word -- xt )
     dup compiled-xts get assoc [ nip ] [ word-xt ] ifte* ;
 
-! "fixup-xts" is a list of [ where word relative ] pairs; the xt
-! of word when its done compiling will be written to the offset,
-! relative to the offset.
+! "deferred-xts" is a list of [ where word relative ] pairs; the
+! xt of word when its done compiling will be written to the
+! offset, relative to the offset.
 
 SYMBOL: deferred-xts
 
@@ -90,6 +93,19 @@ SYMBOL: compile-words
         primitive?
     ] ifte ;
 
+: compiling? ( word -- ? )
+    #! A word that is compiling or already compiled will not be
+    #! added to the list of words to be compiled.
+    dup compiled? [
+        drop t
+    ] [
+        dup compile-words get contains? [
+            drop t
+        ] [
+            compiled-xts get assoc
+        ] ifte
+    ] ifte ;
+
 : fixup-deferred-xt ( word where relative -- )
     rot dup compiled? [
         compiled-xt swap - swap set-compiled-cell
index 3c829b60f01a109d95020bc4f31284adbbb16c7d..b213d867393910a384aa30e35f77712586863459 100644 (file)
@@ -76,7 +76,7 @@ USE: unparser
 
 : serve-directory ( filename -- )
     "/" ?str-tail [
-        dup "index.html" cat2 dup exists? [
+        dup "/index.html" cat2 dup exists? [
             serve-file
         ] [
             drop list-directory
index 607aa81e816bd32a49ce3d0fbf8bca7bf06449c7..530ba06084ebfe705762f0a566beb7235833dc80 100644 (file)
@@ -101,7 +101,7 @@ USE: url-encoding
     ] when* "/" ?str-tail drop ;
 
 : file-link-href ( path -- href )
-    <% "/file/" % resolve-file-link url-encode % %> ;
+    <% "/" % resolve-file-link url-encode % %> ;
 
 : file-link-tag ( style quot -- )
     over "file-link" swap assoc [
index ad358d141f50da283f88c5edb0c4bf92ec730df3..6980053c9ab2542ee86eb1caffa83b6cc0f71e30 100644 (file)
@@ -67,7 +67,7 @@ USE: vectors
     "X re-edit -- edit the expression with number X." print
     "history" get print-numbered-vector ;
 
-: get-history ( index -- )
+: get-history ( index -- str )
     "history" get vector-nth ;
 
 : redo ( index -- )