2010-01-20 10:23:20 -05:00
|
|
|
! Copyright (C) 2006, 2010 Slava Pestov.
|
2007-09-20 18:09:08 -04:00
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
2013-03-10 19:12:40 -04:00
|
|
|
USING: accessors assocs kernel namespaces sequences sets ;
|
2009-03-22 21:16:31 -04:00
|
|
|
IN: definitions
|
2007-09-20 18:09:08 -04:00
|
|
|
|
2013-03-23 19:34:33 -04:00
|
|
|
MIXIN: definition-mixin
|
2009-04-06 14:34:38 -04:00
|
|
|
|
2008-03-20 16:00:49 -04:00
|
|
|
ERROR: no-compilation-unit definition ;
|
2008-01-09 16:51:55 -05:00
|
|
|
|
2013-03-10 19:12:40 -04:00
|
|
|
: add-to-unit ( key set -- )
|
|
|
|
[ adjoin ] [ no-compilation-unit ] if* ;
|
2008-11-03 04:51:28 -05:00
|
|
|
|
2008-08-30 03:31:27 -04:00
|
|
|
SYMBOL: changed-definitions
|
2008-08-30 01:05:27 -04:00
|
|
|
|
2008-08-31 02:34:00 -04:00
|
|
|
: changed-definition ( defspec -- )
|
2013-03-10 19:12:40 -04:00
|
|
|
changed-definitions get add-to-unit ;
|
2008-08-31 02:34:00 -04:00
|
|
|
|
2010-01-29 08:58:39 -05:00
|
|
|
SYMBOL: maybe-changed
|
2010-01-29 03:40:09 -05:00
|
|
|
|
2010-01-29 08:58:39 -05:00
|
|
|
: changed-conditionally ( class -- )
|
2013-03-10 19:12:40 -04:00
|
|
|
maybe-changed get add-to-unit ;
|
2010-01-29 03:40:09 -05:00
|
|
|
|
2009-03-22 21:16:31 -04:00
|
|
|
SYMBOL: changed-effects
|
|
|
|
|
2009-03-13 20:39:32 -04:00
|
|
|
SYMBOL: outdated-generics
|
2008-11-03 04:51:28 -05:00
|
|
|
|
2009-11-13 08:17:00 -05:00
|
|
|
SYMBOL: new-words
|
|
|
|
|
|
|
|
: new-word ( word -- )
|
2013-03-10 19:12:40 -04:00
|
|
|
new-words get add-to-unit ;
|
2009-11-13 08:17:00 -05:00
|
|
|
|
2007-09-20 18:09:08 -04:00
|
|
|
GENERIC: where ( defspec -- loc )
|
|
|
|
|
|
|
|
M: object where drop f ;
|
|
|
|
|
|
|
|
GENERIC: set-where ( loc defspec -- )
|
|
|
|
|
2008-01-09 16:51:55 -05:00
|
|
|
GENERIC: forget* ( defspec -- )
|
|
|
|
|
|
|
|
SYMBOL: forgotten-definitions
|
|
|
|
|
|
|
|
: forgotten-definition ( defspec -- )
|
2013-03-10 19:12:40 -04:00
|
|
|
forgotten-definitions get add-to-unit ;
|
2007-09-20 18:09:08 -04:00
|
|
|
|
2014-11-30 00:46:26 -05:00
|
|
|
: forget ( defspec -- )
|
|
|
|
[ forgotten-definition ] [ forget* ] bi ;
|
2007-09-20 18:09:08 -04:00
|
|
|
|
2009-09-28 04:04:53 -04:00
|
|
|
M: f forget* drop ;
|
|
|
|
|
|
|
|
M: wrapper forget* wrapped>> forget ;
|
|
|
|
|
2007-10-09 17:35:09 -04:00
|
|
|
: forget-all ( definitions -- ) [ forget ] each ;
|
|
|
|
|
2007-09-20 18:09:08 -04:00
|
|
|
GENERIC: definer ( defspec -- start end )
|
|
|
|
|
|
|
|
GENERIC: definition ( defspec -- seq )
|