Index: 3.99.4.21/STklos/stklos.stk --- 3.99.4.21/STklos/stklos.stk Mon, 30 Nov 1998 13:06:22 +0100 eg (STk/c/b/10_stklos.stk 1.28 644) +++ 3.99.5.12(w)/STklos/stklos.stk Thu, 01 Jul 1999 12:08:07 +0200 eg (STk/c/b/10_stklos.stk 1.28 644) @@ -2,7 +2,7 @@ ;;;; s t k l o s . s t k -- A variation of the Gregor Kickzales Tiny CLOS ;;;; for STk ;;;; -;;;; Copyright © 1993-1998 Erick Gallesio - I3S-CNRS/ESSI +;;;; Copyright © 1993-1999 Erick Gallesio - I3S-CNRS/ESSI ;;;; ;;;; Permission to use, copy, and/or distribute this software and its ;;;; documentation for any purpose and without fee is hereby granted, provided @@ -16,7 +16,7 @@ ;;;; ;;;; Author: Erick Gallesio [eg@unice.fr] ;;;; Creation date: 20-Feb-1994 21:09 -;;;; Last file update: 25-Nov-1998 10:39 +;;;; Last file update: 1-Jul-1999 12:08 (when (provided? "stklos") (error "STklos already initialized.")) @@ -40,7 +40,7 @@ method-body compute-get-n-set allocate-instance initialize make-instance make - no-next-method no-applicable-method no-method + no-next-method no-applicable-method no-method next-method-exists? change-class shallow-clone deep-clone apply-generic apply-method apply-methods compute-applicable-methods @@ -470,6 +470,10 @@ (define-method no-method ((gf ) args) (error "No method defined for ~S" gf)) + +(define-macro (next-method-exists?) + `((with-module STklos %next-method-exists?) next-method)) + ;============================================================================= ; ; Cloning functions (from rdeline@CS.CMU.EDU) @@ -910,3 +914,4 @@ (export class-cpl get-slot-allocation slot-definition-initform) (provide "stklos") + Index: 3.99.4.21/Src/stklos.c --- 3.99.4.21/Src/stklos.c Mon, 28 Dec 1998 23:05:11 +0100 eg (STk/X/43_stklos.c 1.17 644) +++ 3.99.5.12(w)/Src/stklos.c Thu, 01 Jul 1999 12:29:24 +0200 eg (STk/X/43_stklos.c 1.18 644) @@ -2,7 +2,7 @@ * * s t k l o s . c -- STklos support * - * Copyright © 1993-1998 Erick Gallesio - I3S-CNRS/ESSI + * Copyright © 1993-1999 Erick Gallesio - I3S-CNRS/ESSI * * * Permission to use, copy, and/or distribute this software and its @@ -20,7 +20,7 @@ * * Author: Erick Gallesio [eg@unice.fr] * Creation date: 9-Feb-1994 15:56 - * Last file update: 20-Dec-1998 10:32 + * Last file update: 1-Jul-1999 12:29 */ #ifdef USE_STKLOS @@ -775,6 +775,18 @@ } } +static PRIMITIVE next_method_exists(SCM next) +{ + if (NTYPEP(next, tc_next_method)) + Err("next-method-exists: bad next method'", next); + return NULLP(NXT_MTHD_METHODS(next))? Ntruth : Truth; +} + +int STk_methodp(SCM obj) +{ + return METHODP(obj); +} + /****************************************************************************** * * Protocol for calling a generic fumction @@ -1187,7 +1199,6 @@ STk_export_symbol(Intern(name), STklos); } - /*===========================================================================*/ PRIMITIVE STk_init_STklos(void) @@ -1238,6 +1249,7 @@ STk_add_new_primitive("%method-more-specific?", tc_subr_3, user_more_specificp); STk_add_new_primitive("%fast-slot-ref", tc_subr_2, fast_slot_ref); STk_add_new_primitive("%fast-slot-set!", tc_subr_3, fast_slot_set); + STk_add_new_primitive("%next-method-exists?", tc_subr_1, next_method_exists); /* Define classes for already defined extended type */ define_extended_type_classes(); Index: 3.99.4.21/Src/stklos.h --- 3.99.4.21/Src/stklos.h Fri, 16 Jan 1998 22:20:00 +0100 eg (STk/X/44_stklos.h 1.5 644) +++ 3.99.5.12(w)/Src/stklos.h Fri, 04 Jun 1999 23:05:18 +0200 eg (STk/X/44_stklos.h 1.6 644) @@ -2,7 +2,7 @@ * * s t k l o s . h -- STklos support * - * Copyright © 1993-1998 Erick Gallesio - I3S-CNRS/ESSI + * Copyright © 1993-1999 Erick Gallesio - I3S-CNRS/ESSI * * * Permission to use, copy, and/or distribute this software and its @@ -19,7 +19,7 @@ * * Author: Erick Gallesio [eg@unice.fr] * Creation date: 9-Feb-1994 15:56 - * Last file update: 16-Jan-1998 22:05 + * Last file update: 4-Jun-1999 23:05 */ #define STKLOS_VERSION STK_VERSION /* Keep STklos version in sync with STk now */ @@ -96,4 +96,5 @@ SCM STk_compute_applicable_methods(SCM gf, SCM args, int len, int find_method); SCM STk_apply_user_generic(SCM gf, SCM args); SCM STk_apply_next_method(SCM next, SCM provided_args); +int STk_methodp(SCM obj);