Merge branch 'master' of git://factorcode.org/git/factor

db4
Joe Groff 2008-06-11 20:09:26 -07:00
commit 85e4a3ba17
6 changed files with 25 additions and 12 deletions

View File

@ -131,6 +131,14 @@ GENERIC: update-methods ( class seq -- )
[ drop update-map+ ]
2tri ;
: forget-predicate ( class -- )
dup "predicate" word-prop
dup length 1 = [
first
tuck "predicating" word-prop =
[ forget ] [ drop ] if
] [ 2drop ] if ;
GENERIC: class ( object -- class )
: instance? ( obj class -- ? )

View File

@ -136,17 +136,16 @@ M: method-body definer
M: method-body forget*
dup "forgotten" word-prop [ drop ] [
[
dup "default" word-prop [ call-next-method ] [
dup
[ "method-class" word-prop ]
[ "method-generic" word-prop ] bi
3dup method eq? [
[ delete-at ] with-methods
call-next-method
] [ 3drop ] if
dup "default" word-prop [ drop ] [
[
[ "method-class" word-prop ]
[ "method-generic" word-prop ] bi
2dup method
] keep eq?
[ [ delete-at ] with-methods ] [ 2drop ] if
] if
]
[ t "forgotten" set-word-prop ] bi
[ call-next-method ] bi
] if ;
M: method-body smart-usage
@ -169,7 +168,7 @@ M: sequence implementors
: forget-class ( class -- )
class-usages [
{
[ "predicate" word-prop [ forget ] each ]
[ forget-predicate ]
[ forget-methods ]
[ update-map- ]
[ reset-class ]

View File

@ -0,0 +1,5 @@
IN: source-files.tests
USING: source-files tools.test assocs sequences strings
namespaces kernel ;
[ { } ] [ source-files get keys [ string? not ] filter ] unit-test

View File

@ -44,6 +44,7 @@ uses definitions ;
\ source-file construct ;
: source-file ( path -- source-file )
dup string? [ "Invalid source file path" throw ] unless
source-files get [ <source-file> ] cache ;
: reset-checksums ( -- )

View File

@ -12,7 +12,7 @@ IN: ui.x11
SINGLETON: x11-ui-backend
: XA_NET_WM_NAME "_NET_WM_NAME" x-atom ;
: XA_NET_WM_NAME ( -- atom ) "_NET_WM_NAME" x-atom ;
TUPLE: x11-handle window glx xic ;

View File

@ -1257,8 +1257,8 @@ FUNCTION: Status XSetStandardProperties (
FUNCTION: void XFree ( void* data ) ;
FUNCTION: int XStoreName ( Display* display, Window w, char* window_name ) ;
FUNCTION: void XSetWMNormalHints ( Display* display, Window w, XSizeHints* hints ) ;
FUNCTION: int XBell ( Display* display, int percent ) ;
! !!! INPUT METHODS