Merge branch 'master' of git://factorcode.org/git/factor

db4
Doug Coleman 2008-04-04 08:48:06 -05:00
commit 8ffd5b61af
6 changed files with 24 additions and 24 deletions

View File

@ -12,8 +12,6 @@ $nl
{ $subsection forget }
"Definitions can answer a sequence of definitions they directly depend on:"
{ $subsection uses }
"When a definition is changed, all definitions which depend on it are notified via a hook:"
{ $subsection redefined* }
"Definitions must implement a few operations used for printing them in source form:"
{ $subsection synopsis* }
{ $subsection definer }
@ -108,11 +106,6 @@ HELP: usage
{ $description "Outputs a sequence of definitions that directly call the given definition." }
{ $notes "The sequence might include the definition itself, if it is a recursive word." } ;
HELP: redefined*
{ $values { "defspec" "a definition specifier" } }
{ $contract "Updates the definition to cope with a callee being redefined." }
$low-level-note ;
HELP: unxref
{ $values { "defspec" "a definition specifier" } }
{ $description "Remove edges leaving the vertex which represents the definition from the " { $link crossref } " graph." }

View File

@ -42,13 +42,6 @@ M: object uses drop f ;
: usage ( defspec -- seq ) \ f or crossref get at keys ;
GENERIC: redefined* ( defspec -- )
M: object redefined* drop ;
: redefined ( defspec -- )
[ crossref get at ] closure [ drop redefined* ] assoc-each ;
: unxref ( defspec -- )
dup uses crossref get remove-vertex ;

View File

@ -121,8 +121,28 @@ SYMBOL: +called+
compiled-usage [ nip +inlined+ eq? ] assoc-subset update
] with each keys ;
M: word redefined* ( word -- )
{ "inferred-effect" "no-effect" } reset-props ;
<PRIVATE
SYMBOL: visited
: reset-on-redefine { "inferred-effect" "no-effect" } ; inline
: (redefined) ( word -- )
dup visited get key? [ drop ] [
[ reset-on-redefine reset-props ]
[ dup visited get set-at ]
[
crossref get at keys [ word? ] subset [
reset-on-redefine [ word-prop ] with contains?
] subset
[ (redefined) ] each
] tri
] if ;
PRIVATE>
: redefined ( word -- )
H{ } clone visited [ (redefined) ] with-variable ;
SYMBOL: changed-words

View File

@ -1,5 +1,5 @@
USING: alien.c-types hardware-info kernel math namespaces
windows windows.kernel32 hardware-info.backend ;
windows windows.kernel32 hardware-info.backend system ;
IN: hardware-info.windows.ce
: memory-status ( -- MEMORYSTATUS )

View File

@ -52,11 +52,6 @@ IN: random-tester.safe-words
>r r>
} ;
: method-words
{
forget-word
} ;
: stateful-words
{
counter
@ -82,7 +77,6 @@ IN: random-tester.safe-words
bignum-words %
initialization-words %
stack-words %
method-words %
stateful-words %
exit-words %
foo-words %

View File

@ -42,7 +42,7 @@ F_WORD *allot_word(CELL vocab, CELL name)
UNREGISTER_ROOT(name);
UNREGISTER_ROOT(vocab);
word->hashcode = tag_fixnum(rand());
word->hashcode = tag_fixnum((rand() << 16) ^ rand());
word->vocabulary = vocab;
word->name = name;
word->def = userenv[UNDEFINED_ENV];