factor/core/definitions/definitions.factor

58 lines
1.2 KiB
Factor
Raw Normal View History

2009-03-22 21:16:31 -04:00
! Copyright (C) 2006, 2009 Slava Pestov.
2007-09-20 18:09:08 -04:00
! See http://factorcode.org/license.txt for BSD license.
2009-04-22 20:36:01 -04:00
USING: kernel sequences namespaces assocs math accessors ;
2009-03-22 21:16:31 -04:00
IN: definitions
2007-09-20 18:09:08 -04:00
2009-04-06 14:34:38 -04:00
MIXIN: definition
2008-03-20 16:00:49 -04:00
ERROR: no-compilation-unit definition ;
2009-03-22 21:16:31 -04:00
SYMBOLS: inlined-dependency flushed-dependency called-dependency ;
: set-in-unit ( value key assoc -- )
[ set-at ] [ 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 -- )
inlined-dependency swap changed-definitions get set-in-unit ;
2008-08-31 02:34:00 -04:00
2009-03-22 21:16:31 -04:00
SYMBOL: changed-effects
2008-08-31 02:34:00 -04:00
SYMBOL: changed-generics
SYMBOL: outdated-generics
2008-08-30 03:32:17 -04:00
SYMBOL: new-classes
: new-class ( word -- )
dup new-classes get set-in-unit ;
2008-08-30 03:32:17 -04:00
: new-class? ( word -- ? )
new-classes get key? ;
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 -- )
2009-04-06 14:26:07 -04:00
M: f forget* drop ;
2009-04-22 20:36:01 -04:00
M: wrapper forget* wrapped>> forget* ;
SYMBOL: forgotten-definitions
: forgotten-definition ( defspec -- )
dup forgotten-definitions get set-in-unit ;
2007-09-20 18:09:08 -04:00
: forget ( defspec -- ) [ forgotten-definition ] [ forget* ] bi ;
2007-09-20 18:09:08 -04:00
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 )