1 ! Copyright (C) 2006, 2010 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors assocs kernel namespaces sequences sets ;
6 MIXIN: definition-mixin
8 ERROR: no-compilation-unit definition ;
10 : add-to-unit ( key set -- )
11 [ adjoin ] [ throw-no-compilation-unit ] if* ;
13 SYMBOL: changed-definitions
15 : changed-definition ( defspec -- )
16 changed-definitions get add-to-unit ;
20 : changed-conditionally ( class -- )
21 maybe-changed get add-to-unit ;
23 SYMBOL: changed-effects
25 SYMBOL: outdated-generics
29 : new-word ( word -- )
30 new-words get add-to-unit ;
32 GENERIC: where ( defspec -- loc )
34 M: object where drop f ;
36 GENERIC: set-where ( loc defspec -- )
38 GENERIC: forget* ( defspec -- )
40 SYMBOL: forgotten-definitions
42 : forgotten-definition ( defspec -- )
43 forgotten-definitions get add-to-unit ;
45 : forget ( defspec -- )
46 [ forgotten-definition ] [ forget* ] bi ;
50 M: wrapper forget* wrapped>> forget ;
52 : forget-all ( definitions -- ) [ forget ] each ;
54 GENERIC: definer ( defspec -- start end )
56 GENERIC: definition ( defspec -- seq )