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
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
] 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 [
"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 -- )