diff --git a/library/compiler/compiler.factor b/library/compiler/compiler.factor index 641fe58fac..ca3b8c4a61 100644 --- a/library/compiler/compiler.factor +++ b/library/compiler/compiler.factor @@ -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 diff --git a/library/httpd/file-responder.factor b/library/httpd/file-responder.factor index 3c829b60f0..b213d86739 100644 --- a/library/httpd/file-responder.factor +++ b/library/httpd/file-responder.factor @@ -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 diff --git a/library/httpd/html.factor b/library/httpd/html.factor index 607aa81e81..530ba06084 100644 --- a/library/httpd/html.factor +++ b/library/httpd/html.factor @@ -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 [ diff --git a/library/interpreter.factor b/library/interpreter.factor index ad358d141f..6980053c9a 100644 --- a/library/interpreter.factor +++ b/library/interpreter.factor @@ -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 -- )