factor/core/definitions/definitions.factor

59 lines
1.2 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.
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 ;
: 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 -- )
dup changed-definitions get set-in-unit ;
2008-08-31 02:34:00 -04:00
SYMBOL: maybe-changed
: changed-conditionally ( class -- )
dup maybe-changed get set-in-unit ;
2009-03-22 21:16:31 -04:00
SYMBOL: changed-effects
SYMBOL: outdated-generics
SYMBOL: new-words
: new-word ( word -- )
dup new-words get set-in-unit ;
: new-word? ( word -- ? )
new-words 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 -- )
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
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 )