]> gitweb.factorcode.org Git - factor.git/blob - core/definitions/definitions.factor
change ERROR: words from throw-foo back to foo.
[factor.git] / core / definitions / definitions.factor
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 ;
4 IN: definitions
5
6 MIXIN: definition-mixin
7
8 ERROR: no-compilation-unit definition ;
9
10 : add-to-unit ( key set -- )
11     [ adjoin ] [ no-compilation-unit ] if* ;
12
13 SYMBOL: changed-definitions
14
15 : changed-definition ( defspec -- )
16     changed-definitions get add-to-unit ;
17
18 SYMBOL: maybe-changed
19
20 : changed-conditionally ( class -- )
21     maybe-changed get add-to-unit ;
22
23 SYMBOL: changed-effects
24
25 SYMBOL: outdated-generics
26
27 SYMBOL: new-words
28
29 : new-word ( word -- )
30     new-words get add-to-unit ;
31
32 GENERIC: where ( defspec -- loc )
33
34 M: object where drop f ;
35
36 GENERIC: set-where ( loc defspec -- )
37
38 GENERIC: forget* ( defspec -- )
39
40 SYMBOL: forgotten-definitions
41
42 : forgotten-definition ( defspec -- )
43     forgotten-definitions get add-to-unit ;
44
45 : forget ( defspec -- )
46     [ forgotten-definition ] [ forget* ] bi ;
47
48 M: f forget* drop ;
49
50 M: wrapper forget* wrapped>> forget ;
51
52 : forget-all ( definitions -- ) [ forget ] each ;
53
54 GENERIC: definer ( defspec -- start end )
55
56 GENERIC: definition ( defspec -- seq )