factor/core/definitions/definitions.factor

57 lines
1.2 KiB
Factor
Raw Normal View History

! Copyright (C) 2006, 2008 Slava Pestov.
2007-09-20 18:09:08 -04:00
! See http://factorcode.org/license.txt for BSD license.
IN: definitions
USING: kernel sequences namespaces assocs graphs ;
2007-09-20 18:09:08 -04:00
2008-03-20 16:00:49 -04:00
ERROR: no-compilation-unit definition ;
2008-04-05 08:00:09 -04:00
SYMBOL: changed-definitions
: changed-definition ( defspec -- )
dup changed-definitions get
[ no-compilation-unit ] unless*
set-at ;
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 -- )
M: object forget* drop ;
SYMBOL: forgotten-definitions
: forgotten-definition ( defspec -- )
dup forgotten-definitions get
[ no-compilation-unit ] unless*
set-at ;
2007-09-20 18:09:08 -04:00
: forget ( defspec -- ) dup forgotten-definition forget* ;
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: synopsis* ( defspec -- )
GENERIC: definer ( defspec -- start end )
GENERIC: definition ( defspec -- seq )
SYMBOL: crossref
GENERIC: uses ( defspec -- seq )
M: object uses drop f ;
: xref ( defspec -- ) dup uses crossref get add-vertex ;
2008-02-23 23:29:29 -05:00
: usage ( defspec -- seq ) \ f or crossref get at keys ;
2007-09-20 18:09:08 -04:00
: unxref ( defspec -- )
dup uses crossref get remove-vertex ;
: delete-xref ( defspec -- )
dup unxref crossref get delete-at ;