factor/core/definitions/definitions.factor

57 lines
1.1 KiB
Factor
Raw Normal View History

! 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
MIXIN: definition-mixin
2009-04-06 14:34:38 -04:00
2008-03-20 16:00:49 -04:00
ERROR: no-compilation-unit definition ;
2013-03-10 19:12:40 -04:00
: add-to-unit ( key set -- )
[ adjoin ] [ no-compilation-unit ] if* ;
2008-08-30 03:31:27 -04:00
SYMBOL: changed-definitions
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
SYMBOL: maybe-changed
: changed-conditionally ( class -- )
2013-03-10 19:12:40 -04:00
maybe-changed get add-to-unit ;
2009-03-22 21:16:31 -04:00
SYMBOL: changed-effects
SYMBOL: outdated-generics
SYMBOL: new-words
: new-word ( word -- )
2013-03-10 19:12:40 -04:00
new-words get add-to-unit ;
2007-09-20 18:09:08 -04:00
GENERIC: where ( defspec -- loc )
M: object where drop f ;
GENERIC: set-where ( loc defspec -- )
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
: forget ( defspec -- )
[ forgotten-definition ] [ forget* ] bi ;
2007-09-20 18:09:08 -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 )