From c1509d5fe52cd434f73669ab1a9127b396232c41 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 11 Jun 2008 20:46:53 -0500 Subject: [PATCH 1/3] Fix more redefinition problems --- core/classes/classes.factor | 8 ++++++++ core/generic/generic.factor | 19 +++++++++---------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/core/classes/classes.factor b/core/classes/classes.factor index ba5b43dc80..9c0398cf61 100755 --- a/core/classes/classes.factor +++ b/core/classes/classes.factor @@ -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 -- ? ) diff --git a/core/generic/generic.factor b/core/generic/generic.factor index 7bc4c2bb54..8bcbe090b1 100755 --- a/core/generic/generic.factor +++ b/core/generic/generic.factor @@ -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 ] From f9ed7ac1aeb10cf0924995fa79abed91b8219f80 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 11 Jun 2008 21:12:17 -0500 Subject: [PATCH 2/3] Add sanity check --- core/source-files/source-files-tests.factor | 5 +++++ core/source-files/source-files.factor | 1 + 2 files changed, 6 insertions(+) create mode 100644 core/source-files/source-files-tests.factor diff --git a/core/source-files/source-files-tests.factor b/core/source-files/source-files-tests.factor new file mode 100644 index 0000000000..e5e04c777f --- /dev/null +++ b/core/source-files/source-files-tests.factor @@ -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 diff --git a/core/source-files/source-files.factor b/core/source-files/source-files.factor index 36a1806e12..454f148974 100755 --- a/core/source-files/source-files.factor +++ b/core/source-files/source-files.factor @@ -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 [ ] cache ; : reset-checksums ( -- ) From b8aad679463541456b175cf3b7834056738bb20d Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 11 Jun 2008 21:14:20 -0500 Subject: [PATCH 3/3] Fix X11 UI load error --- extra/ui/x11/x11.factor | 2 +- extra/x11/xlib/xlib.factor | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extra/ui/x11/x11.factor b/extra/ui/x11/x11.factor index 1ba0c96a4d..70962b1ba0 100755 --- a/extra/ui/x11/x11.factor +++ b/extra/ui/x11/x11.factor @@ -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 ; diff --git a/extra/x11/xlib/xlib.factor b/extra/x11/xlib/xlib.factor index 3c0ae24a70..6fc586106c 100755 --- a/extra/x11/xlib/xlib.factor +++ b/extra/x11/xlib/xlib.factor @@ -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