diff --git a/core/bootstrap/primitives.factor b/core/bootstrap/primitives.factor index d5cedaf7b3..c9329a2c9f 100755 --- a/core/bootstrap/primitives.factor +++ b/core/bootstrap/primitives.factor @@ -5,7 +5,7 @@ USING: alien arrays byte-arrays generic hashtables hashtables.private io kernel math namespaces parser sequences strings vectors words quotations assocs layouts classes tuples kernel.private vocabs vocabs.loader source-files definitions -slots classes.union words.private ; +slots classes.union words.private compiler.units ; ! Some very tricky code creating a bootstrap embryo in the ! host image. diff --git a/core/bootstrap/stage2.factor b/core/bootstrap/stage2.factor index 468f9250cc..2bcd4ce82f 100755 --- a/core/bootstrap/stage2.factor +++ b/core/bootstrap/stage2.factor @@ -80,5 +80,5 @@ IN: bootstrap.stage2 "output-image" get resource-path save-image-and-exit ] if ] [ - error-hook get call "listener" vocab-main execute + error. :c "listener" vocab-main execute ] recover diff --git a/core/classes/mixin/mixin.factor b/core/classes/mixin/mixin.factor index 847cce30bf..f9b987eb78 100755 --- a/core/classes/mixin/mixin.factor +++ b/core/classes/mixin/mixin.factor @@ -68,7 +68,7 @@ M: mixin-instance definer drop \ INSTANCE: f ; M: mixin-instance definition drop f ; -M: mixin-instance forget +M: mixin-instance forget* dup mixin-instance-class swap mixin-instance-mixin dup mixin-class? [ remove-mixin-instance ] [ 2drop ] if ; diff --git a/core/compiler/units/units.factor b/core/compiler/units/units.factor index 93994012e3..af56f1796b 100755 --- a/core/compiler/units/units.factor +++ b/core/compiler/units/units.factor @@ -56,16 +56,17 @@ GENERIC: definitions-changed ( assoc obj -- ) definition-observers get [ definitions-changed ] curry* each ; -: changed-vocabs ( -- assoc ) - changed-words get +: changed-vocabs ( assoc -- vocabs ) + [ drop word? ] assoc-subset [ drop word-vocabulary dup [ vocab ] when dup ] assoc-map ; : changed-definitions ( -- assoc ) H{ } clone + dup forgotten-definitions get update dup new-definitions get first update dup new-definitions get second update dup changed-words get update - dup changed-vocabs update ; + dup dup changed-vocabs update ; : finish-compilation-unit ( -- ) changed-words get keys recompile-hook get call @@ -74,6 +75,7 @@ GENERIC: definitions-changed ( assoc obj -- ) : with-compilation-unit ( quot -- ) [ H{ } clone changed-words set + H{ } clone forgotten-definitions set new-definitions set old-definitions set [ finish-compilation-unit ] diff --git a/core/cpu/x86/bootstrap.factor b/core/cpu/x86/bootstrap.factor index 7b609ab1c9..fd5a4703a8 100755 --- a/core/cpu/x86/bootstrap.factor +++ b/core/cpu/x86/bootstrap.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: bootstrap.image.private kernel namespaces system cpu.x86.assembler layouts compiler.units math generator.fixup -compiler.constants ; +compiler.constants vocabs ; IN: bootstrap.x86 big-endian off diff --git a/core/debugger/debugger.factor b/core/debugger/debugger.factor index 1d5185deb1..77c6da38e9 100755 --- a/core/debugger/debugger.factor +++ b/core/debugger/debugger.factor @@ -230,5 +230,5 @@ M: undefined summary M: no-compilation-unit error. "Attempting to define " write - no-compilation-unit-word pprint + no-compilation-unit-definition pprint " outside of a compilation unit" print ; diff --git a/core/definitions/definitions.factor b/core/definitions/definitions.factor index 6508d30216..ad261df7d4 100755 --- a/core/definitions/definitions.factor +++ b/core/definitions/definitions.factor @@ -3,15 +3,29 @@ IN: definitions USING: kernel sequences namespaces assocs graphs ; +TUPLE: no-compilation-unit definition ; + +: no-compilation-unit ( definition -- * ) + \ no-compilation-unit construct-boa throw ; + GENERIC: where ( defspec -- loc ) M: object where drop f ; GENERIC: set-where ( loc defspec -- ) -GENERIC: forget ( defspec -- ) +GENERIC: forget* ( defspec -- ) -M: object forget drop ; +M: object forget* drop ; + +SYMBOL: forgotten-definitions + +: forgotten-definition ( defspec -- ) + dup forgotten-definitions get + [ no-compilation-unit ] unless* + set-at ; + +: forget ( defspec -- ) dup forgotten-definition forget* ; : forget-all ( definitions -- ) [ forget ] each ; diff --git a/core/generic/generic.factor b/core/generic/generic.factor index d57c4500e2..7c56d43b72 100755 --- a/core/generic/generic.factor +++ b/core/generic/generic.factor @@ -85,7 +85,7 @@ M: method-spec definer drop \ M: \ ; ; M: method-spec definition first2 method method-def ; -M: method-spec forget first2 [ delete-at ] with-methods ; +M: method-spec forget* first2 [ delete-at ] with-methods ; : implementors* ( classes -- words ) all-words [ @@ -99,7 +99,7 @@ M: method-spec forget first2 [ delete-at ] with-methods ; : forget-methods ( class -- ) [ implementors ] keep [ swap 2array ] curry map forget-all ; -M: class forget ( class -- ) +M: class forget* ( class -- ) dup forget-methods dup uncache-class forget-word ; diff --git a/core/source-files/source-files.factor b/core/source-files/source-files.factor index 6f50502f54..80538e2cf5 100755 --- a/core/source-files/source-files.factor +++ b/core/source-files/source-files.factor @@ -73,7 +73,7 @@ uses definitions ; M: pathname where pathname-string 1 2array ; -M: pathname forget +M: pathname forget* pathname-string dup source-file dup unxref-source diff --git a/core/vocabs/vocabs.factor b/core/vocabs/vocabs.factor index c47798e414..daa5658c07 100755 --- a/core/vocabs/vocabs.factor +++ b/core/vocabs/vocabs.factor @@ -105,4 +105,4 @@ UNION: vocab-spec vocab vocab-link ; dup vocab-words values forget-all vocab-name dictionary get delete-at ; -M: vocab-spec forget forget-vocab ; +M: vocab-spec forget* forget-vocab ; diff --git a/core/words/words.factor b/core/words/words.factor index b36e5cba81..e05fc0009a 100755 --- a/core/words/words.factor +++ b/core/words/words.factor @@ -92,11 +92,6 @@ M: word redefined* ( word -- ) SYMBOL: changed-words -TUPLE: no-compilation-unit word ; - -: no-compilation-unit ( word -- * ) - \ no-compilation-unit construct-boa throw ; - : changed-word ( word -- ) dup changed-words get [ no-compilation-unit ] unless* @@ -194,7 +189,7 @@ M: word (forget-word) dup delete-xref (forget-word) ; -M: word forget forget-word ; +M: word forget* forget-word ; M: word hashcode* nip 1 slot { fixnum } declare ; diff --git a/extra/help/definitions/definitions.factor b/extra/help/definitions/definitions.factor index 559acf3919..4d942ae3a9 100755 --- a/extra/help/definitions/definitions.factor +++ b/extra/help/definitions/definitions.factor @@ -12,7 +12,7 @@ M: link where link-name article article-loc ; M: link set-where link-name article set-article-loc ; -M: link forget link-name remove-article ; +M: link forget* link-name remove-article ; M: link definition article-content ; @@ -34,4 +34,4 @@ M: word-link synopsis* link-name dup pprint-word stack-effect. ; -M: word-link forget link-name remove-word-help ; +M: word-link forget* link-name remove-word-help ; diff --git a/extra/sudoku/deploy.factor b/extra/sudoku/deploy.factor new file mode 100755 index 0000000000..de60bed20b --- /dev/null +++ b/extra/sudoku/deploy.factor @@ -0,0 +1,13 @@ +USING: tools.deploy.config ; +H{ + { deploy-reflection 2 } + { deploy-word-props? f } + { deploy-compiler? t } + { deploy-math? f } + { deploy-c-types? f } + { deploy-io 2 } + { deploy-ui? f } + { deploy-name "Sudoku" } + { "stop-after-last-window?" t } + { deploy-word-defs? f } +}