Index: ChangeLog =================================================================== diff -u -r99bd33b963fde1d8c93383fab145234724f2f063 -r34f178fae21c3cf3a2410c7b1986d3e6b84dcf42 --- ChangeLog (.../ChangeLog) (revision 99bd33b963fde1d8c93383fab145234724f2f063) +++ ChangeLog (.../ChangeLog) (revision 34f178fae21c3cf3a2410c7b1986d3e6b84dcf42) @@ -1,3 +1,14 @@ +2008-06-23 + * remove pattern argument from "info class" + * additional argument for "info precedence": "-intrinsic" + Syntax: + info precedence ?-intrinsic? ?pattern? + If "-intrinsic" is specified, only the classes of the + superclass type hierarchy are returnd. Otherwise, + the precedence contains mixin classes as well. + * Check results for guards to be boolean instead + of int (now, guards are allowed to return e.g. "true") + 2008-05-30 * updating language reference Index: configure =================================================================== diff -u -r8013b53cd7dd9e5eb6f5bc9e119556314f4922b4 -r34f178fae21c3cf3a2410c7b1986d3e6b84dcf42 --- configure (.../configure) (revision 8013b53cd7dd9e5eb6f5bc9e119556314f4922b4) +++ configure (.../configure) (revision 34f178fae21c3cf3a2410c7b1986d3e6b84dcf42) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for xotcl 1.6.0. +# Generated by GNU Autoconf 2.59 for xotcl 1.6.1. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation @@ -267,8 +267,8 @@ # Identity of this package. PACKAGE_NAME='xotcl' PACKAGE_TARNAME='xotcl' -PACKAGE_VERSION='1.6.0' -PACKAGE_STRING='xotcl 1.6.0' +PACKAGE_VERSION='1.6.1' +PACKAGE_STRING='xotcl 1.6.1' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. @@ -777,7 +777,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures xotcl 1.6.0 to adapt to many kinds of systems. +\`configure' configures xotcl 1.6.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -834,7 +834,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xotcl 1.6.0:";; + short | recursive ) echo "Configuration of xotcl 1.6.1:";; esac cat <<\_ACEOF @@ -979,7 +979,7 @@ test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -xotcl configure 1.6.0 +xotcl configure 1.6.1 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. @@ -993,7 +993,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by xotcl $as_me 1.6.0, which was +It was created by xotcl $as_me 1.6.1, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -1572,7 +1572,7 @@ # do not modify the following lines manually, they are generated with changeXOTclVersion XOTCL_MAJOR_VERSION=1 XOTCL_MINOR_VERSION=6 -XOTCL_RELEASE_LEVEL=.0 +XOTCL_RELEASE_LEVEL=.1 XOTCL_VERSION=${XOTCL_MAJOR_VERSION}.${XOTCL_MINOR_VERSION} NODOT_VERSION=${XOTCL_MAJOR_VERSION}${XOTCL_MINOR_VERSION} @@ -10804,7 +10804,7 @@ } >&5 cat >&5 <<_CSEOF -This file was extended by xotcl $as_me 1.6.0, which was +This file was extended by xotcl $as_me 1.6.1, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -10859,7 +10859,7 @@ cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -xotcl config.status 1.6.0 +xotcl config.status 1.6.1 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" @@ -11487,3 +11487,5 @@ + + Index: configure.in =================================================================== diff -u -r8013b53cd7dd9e5eb6f5bc9e119556314f4922b4 -r34f178fae21c3cf3a2410c7b1986d3e6b84dcf42 --- configure.in (.../configure.in) (revision 8013b53cd7dd9e5eb6f5bc9e119556314f4922b4) +++ configure.in (.../configure.in) (revision 34f178fae21c3cf3a2410c7b1986d3e6b84dcf42) @@ -11,7 +11,7 @@ # for this package, and can be a relative path, such as: # #-------------------------------------------------------------------- -define(XOTclVersion, 1.6.0) +define(XOTclVersion, 1.6.1) AC_INIT([xotcl], [XOTclVersion]) #-------------------------------------------------------------------- @@ -104,7 +104,7 @@ # do not modify the following lines manually, they are generated with changeXOTclVersion XOTCL_MAJOR_VERSION=1 XOTCL_MINOR_VERSION=6 -XOTCL_RELEASE_LEVEL=.0 +XOTCL_RELEASE_LEVEL=.1 XOTCL_VERSION=${XOTCL_MAJOR_VERSION}.${XOTCL_MINOR_VERSION} NODOT_VERSION=${XOTCL_MAJOR_VERSION}${XOTCL_MINOR_VERSION} @@ -499,3 +499,5 @@ + + Index: doc/langRef.xotcl =================================================================== diff -u -r99bd33b963fde1d8c93383fab145234724f2f063 -r34f178fae21c3cf3a2410c7b1986d3e6b84dcf42 --- doc/langRef.xotcl (.../langRef.xotcl) (revision 99bd33b963fde1d8c93383fab145234724f2f063) +++ doc/langRef.xotcl (.../langRef.xotcl) (revision 34f178fae21c3cf3a2410c7b1986d3e6b84dcf42) @@ -503,10 +503,8 @@ <@li><@TT>objName info body method: Returns the body of the specified proc (object specific method). - <@li><@TT>objName info class ?classname?: - Returns the name of the class of the current object, if className was - not specified, otherwise it returns 1 if className matches the - object's class and 0 if not. + <@li><@TT>objName info class: + Returns the name of the class of the current object. <@li><@TT>objName info children ?pattern?: Returns the list of aggregated objects with fully qualified names if @@ -590,9 +588,11 @@ defined for the object if <@TT>pattern was not specified, otherwise it returns all procs that match the pattern. - <@li><@TT>objName info precedence ?pattern?: Returns all + <@li><@TT>objName info precedence ?-intrinsic? ?pattern?: Returns all classes in the precedence order from which the specified - object inherits methods. The returned list of classes contains + object inherits methods. If the flag <@TT>-intrinsic is specified + only the intrinsic classes (from the class hierarchy) are specified. + If the flag is not specified, the returned list of classes contains the mixin and instmixin classes as well as the classes of the superclass chain in linearized order (i.e., duplicate classes are removed). If the pattern is specified, only matching classes Index: generic/xotcl.c =================================================================== diff -u -r99bd33b963fde1d8c93383fab145234724f2f063 -r34f178fae21c3cf3a2410c7b1986d3e6b84dcf42 --- generic/xotcl.c (.../xotcl.c) (revision 99bd33b963fde1d8c93383fab145234724f2f063) +++ generic/xotcl.c (.../xotcl.c) (revision 34f178fae21c3cf3a2410c7b1986d3e6b84dcf42) @@ -2860,10 +2860,8 @@ ObjStr(Tcl_GetObjResult(interp))); */ if (result == TCL_OK) { - result = Tcl_GetIntFromObj(interp, Tcl_GetObjResult(interp),&success); - /* - fprintf(stderr, " success=%d\n", success); - */ + result = Tcl_GetBooleanFromObj(interp, Tcl_GetObjResult(interp),&success); + if (result == TCL_OK && success == 0) result = XOTCL_CHECK_FAILED; } @@ -6274,26 +6272,10 @@ return TCL_OK; } -static int XOTclCInfoMethod(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST v[]); - static int -ListClass(Tcl_Interp *interp, XOTclObject *obj, char *pattern, - int objc, Tcl_Obj *CONST objv[]) { - if (pattern == NULL) { - Tcl_SetObjResult(interp, obj->cl->object.cmdName); - return TCL_OK; - } else { - int result; - ALLOC_ON_STACK(Tcl_Obj*, objc, ov); - - memcpy(ov, objv, sizeof(Tcl_Obj *)*objc); - ov[1] = Tcl_NewStringObj("superclass", 10); - INCR_REF_COUNT(ov[1]); - result = XOTclCInfoMethod((ClientData)obj->cl, interp, objc, ov); - DECR_REF_COUNT(ov[1]); - FREE_ON_STACK(ov); - return result; - } +ListClass(Tcl_Interp *interp, XOTclObject *obj, int objc, Tcl_Obj *CONST objv[]) { + Tcl_SetObjResult(interp, obj->cl->object.cmdName); + return TCL_OK; } static int @@ -6308,21 +6290,24 @@ } static int -ListPrecedence(Tcl_Interp *interp, XOTclObject *obj, char *pattern) { +ListPrecedence(Tcl_Interp *interp, XOTclObject *obj, char *pattern, int intrinsicOnly) { XOTclClasses *pl; Tcl_ResetResult(interp); - if (!(obj->flags & XOTCL_MIXIN_ORDER_VALID)) - MixinComputeDefined(interp, obj); - if (obj->flags & XOTCL_MIXIN_ORDER_DEFINED_AND_VALID) { - XOTclCmdList *ml = obj->mixinOrder; - for(; ml; ml = ml->next) { - XOTclClass *mixin = XOTclGetClassFromCmdPtr(ml->cmdPtr); - AppendMatchingElement(interp, mixin->object.cmdName, pattern); + if (!intrinsicOnly) { + if (!(obj->flags & XOTCL_MIXIN_ORDER_VALID)) + MixinComputeDefined(interp, obj); + + if (obj->flags & XOTCL_MIXIN_ORDER_DEFINED_AND_VALID) { + XOTclCmdList *ml = obj->mixinOrder; + for (; ml; ml = ml->next) { + XOTclClass *mixin = XOTclGetClassFromCmdPtr(ml->cmdPtr); + AppendMatchingElement(interp, mixin->object.cmdName, pattern); + } } } - pl = ComputeOrder(obj->cl, obj->cl->order, Super); - for (; pl != 0; pl = pl->next) { + + for (pl = ComputeOrder(obj->cl, obj->cl->order, Super); pl != 0; pl = pl->next) { AppendMatchingElement(interp, pl->cl->object.cmdName, pattern); } return TCL_OK; @@ -8357,19 +8342,19 @@ case 'c': if (isClassString(cmd)) { - if (objc > 3 || modifiers > 0) - return XOTclObjErrArgCnt(interp, obj->cmdName, "info class ?class?"); - return ListClass(interp, obj, pattern, objc, objv); + if (objc > 3 || modifiers > 0 || pattern) + return XOTclObjErrArgCnt(interp, obj->cmdName, "info class"); + return ListClass(interp, obj, objc, objv); } else if (!strcmp(cmd, "commands")) { if (objc > 3 || modifiers > 0) - return XOTclObjErrArgCnt(interp, obj->cmdName, "info commands ?pat?"); + return XOTclObjErrArgCnt(interp, obj->cmdName, "info commands ?pattern?"); if (nsp) return ListKeys(interp, Tcl_Namespace_cmdTable(nsp), pattern); else return TCL_OK; } else if (!strcmp(cmd, "children")) { if (objc > 3 || modifiers > 0) - return XOTclObjErrArgCnt(interp, obj->cmdName, "info children ?pat?"); + return XOTclObjErrArgCnt(interp, obj->cmdName, "info children ?pattern?"); return ListChildren(interp, obj, pattern, 0); } else if (!strcmp(cmd, "check")) { if (objc != 2 || modifiers > 0) @@ -8404,7 +8389,7 @@ int withGuards = 0, withOrder = 0; if (objc-modifiers > 3) return XOTclObjErrArgCnt(interp, obj->cmdName, - "info filter ?-guards? ?-order? ?pat?"); + "info filter ?-guards? ?-order? ?pattern?"); if (modifiers > 0) { withGuards = checkForModifier(objv, modifiers, "-guards"); withOrder = checkForModifier(objv, modifiers, "-order"); @@ -8512,7 +8497,7 @@ int noprocs = 0, nocmds = 0, nomixins = 0, inContext = 0; if (objc-modifiers > 3) return XOTclObjErrArgCnt(interp, obj->cmdName, - "info methods ?-noprocs? ?-nocmds? ?-nomixins? ?-incontext? ?pat?"); + "info methods ?-noprocs? ?-nocmds? ?-nomixins? ?-incontext? ?pattern?"); if (modifiers > 0) { noprocs = checkForModifier(objv, modifiers, "-noprocs"); nocmds = checkForModifier(objv, modifiers, "-nocmds"); @@ -8524,7 +8509,7 @@ #ifdef XOTCL_METADATA else if (!strcmp(cmd, "metadata")) { if (objc > 3 || modifiers > 0) - return XOTclObjErrArgCnt(interp, obj->cmdName, "info metadata ?pat?"); + return XOTclObjErrArgCnt(interp, obj->cmdName, "info metadata ?pattern?"); return ListKeys(interp, &obj->metaData, pattern); } #endif @@ -8548,7 +8533,7 @@ case 'p': if (!strcmp(cmd, "procs")) { if (objc > 3 || modifiers > 0) - return XOTclObjErrArgCnt(interp, obj->cmdName, "info procs ?pat?"); + return XOTclObjErrArgCnt(interp, obj->cmdName, "info procs ?pattern?"); if (nsp) return ListMethodKeys(interp, Tcl_Namespace_cmdTable(nsp), pattern, /*noProcs*/ 0, /*noCmds*/ 1, /* noDups */ 0, @@ -8578,7 +8563,12 @@ } return TCL_OK; } else if (!strcmp(cmd, "precedence")) { - return ListPrecedence(interp, obj, pattern); + int intrinsic = 0; + if (objc-modifiers > 3 || modifiers > 1) + return XOTclObjErrArgCnt(interp, obj->cmdName, "info precedence ?-intrinsic? ?pattern?"); + + intrinsic = checkForModifier(objv, modifiers, "-intrinsic"); + return ListPrecedence(interp, obj, pattern, intrinsic); } else if (!strcmp(cmd, "parametercmd")) { int argc = objc-modifiers; if (argc < 2) @@ -8596,7 +8586,7 @@ case 'v': if (!strcmp(cmd, "vars")) { if (objc > 3 || modifiers > 0) - return XOTclObjErrArgCnt(interp, obj->cmdName, "info vars ?pat?"); + return XOTclObjErrArgCnt(interp, obj->cmdName, "info vars ?pattern?"); return ListVars(interp, obj, pattern); } break; @@ -10699,7 +10689,7 @@ case 'c': if (!strcmp(cmd, "classchildren")) { if (objc > 3 || modifiers > 0) - return XOTclObjErrArgCnt(interp, cl->object.cmdName, "info classchildren ?pat?"); + return XOTclObjErrArgCnt(interp, cl->object.cmdName, "info classchildren ?pattern?"); return ListChildren(interp, (XOTclObject*) cl, pattern, 1); } else if (!strcmp(cmd, "classparent")) { if (objc > 2 || modifiers > 0) @@ -10711,7 +10701,7 @@ case 'h': if (!strcmp(cmd, "heritage")) { if (objc > 3 || modifiers > 0) - return XOTclObjErrArgCnt(interp, cl->object.cmdName, "info heritage ?pat?"); + return XOTclObjErrArgCnt(interp, cl->object.cmdName, "info heritage ?pattern?"); return ListHeritage(interp, cl, pattern); } break; @@ -10776,7 +10766,7 @@ if (!strcmp(cmdTail, "commands")) { if (objc > 3 || modifiers > 0) return XOTclObjErrArgCnt(interp, cl->object.cmdName, - "info instcommands ?pat?"); + "info instcommands ?pattern?"); return ListKeys(interp, Tcl_Namespace_cmdTable(nsp), pattern); } break; @@ -10805,7 +10795,7 @@ int withGuards = 0; if (objc-modifiers > 3) return XOTclObjErrArgCnt(interp, cl->object.cmdName, - "info instfilter ?-guards? ?pat?"); + "info instfilter ?-guards? ?pattern?"); if (modifiers > 0) { withGuards = checkForModifier(objv, modifiers, "-guards"); if (withGuards == 0) @@ -10953,7 +10943,7 @@ case 'p': if (!strcmp(cmdTail, "procs")) { if (objc > 3 || modifiers > 0) - return XOTclObjErrArgCnt(interp, cl->object.cmdName, "info instprocs ?pat?"); + return XOTclObjErrArgCnt(interp, cl->object.cmdName, "info instprocs ?pattern?"); return ListMethodKeys(interp, Tcl_Namespace_cmdTable(nsp), pattern, /*noProcs*/ 0, /*noCmds*/ 1, /* noDups */ 0, 0, 0); } else if (!strcmp(cmdTail, "pre")) { Index: library/lib/changeXOTclVersion.xotcl =================================================================== diff -u -r8013b53cd7dd9e5eb6f5bc9e119556314f4922b4 -r34f178fae21c3cf3a2410c7b1986d3e6b84dcf42 --- library/lib/changeXOTclVersion.xotcl (.../changeXOTclVersion.xotcl) (revision 8013b53cd7dd9e5eb6f5bc9e119556314f4922b4) +++ library/lib/changeXOTclVersion.xotcl (.../changeXOTclVersion.xotcl) (revision 34f178fae21c3cf3a2410c7b1986d3e6b84dcf42) @@ -6,7 +6,7 @@ # set XOTCL_MAJOR_VERSION 1 set XOTCL_MINOR_VERSION 6 -set XOTCL_RELEASE_LEVEL .0 +set XOTCL_RELEASE_LEVEL .1 # example settings: # 1.0 Index: library/store/XOTclGdbm/configure =================================================================== diff -u -r8013b53cd7dd9e5eb6f5bc9e119556314f4922b4 -r34f178fae21c3cf3a2410c7b1986d3e6b84dcf42 --- library/store/XOTclGdbm/configure (.../configure) (revision 8013b53cd7dd9e5eb6f5bc9e119556314f4922b4) +++ library/store/XOTclGdbm/configure (.../configure) (revision 34f178fae21c3cf3a2410c7b1986d3e6b84dcf42) @@ -11004,3 +11004,5 @@ + + Index: library/store/XOTclGdbm/configure.in =================================================================== diff -u -r8013b53cd7dd9e5eb6f5bc9e119556314f4922b4 -r34f178fae21c3cf3a2410c7b1986d3e6b84dcf42 --- library/store/XOTclGdbm/configure.in (.../configure.in) (revision 8013b53cd7dd9e5eb6f5bc9e119556314f4922b4) +++ library/store/XOTclGdbm/configure.in (.../configure.in) (revision 34f178fae21c3cf3a2410c7b1986d3e6b84dcf42) @@ -289,3 +289,5 @@ + + Index: library/store/XOTclSdbm/configure =================================================================== diff -u -r8013b53cd7dd9e5eb6f5bc9e119556314f4922b4 -r34f178fae21c3cf3a2410c7b1986d3e6b84dcf42 --- library/store/XOTclSdbm/configure (.../configure) (revision 8013b53cd7dd9e5eb6f5bc9e119556314f4922b4) +++ library/store/XOTclSdbm/configure (.../configure) (revision 34f178fae21c3cf3a2410c7b1986d3e6b84dcf42) @@ -10950,3 +10950,5 @@ + + Index: library/store/XOTclSdbm/configure.in =================================================================== diff -u -r8013b53cd7dd9e5eb6f5bc9e119556314f4922b4 -r34f178fae21c3cf3a2410c7b1986d3e6b84dcf42 --- library/store/XOTclSdbm/configure.in (.../configure.in) (revision 8013b53cd7dd9e5eb6f5bc9e119556314f4922b4) +++ library/store/XOTclSdbm/configure.in (.../configure.in) (revision 34f178fae21c3cf3a2410c7b1986d3e6b84dcf42) @@ -248,3 +248,5 @@ + + Index: library/xml/TclExpat-1.1/configure =================================================================== diff -u -r8013b53cd7dd9e5eb6f5bc9e119556314f4922b4 -r34f178fae21c3cf3a2410c7b1986d3e6b84dcf42 --- library/xml/TclExpat-1.1/configure (.../configure) (revision 8013b53cd7dd9e5eb6f5bc9e119556314f4922b4) +++ library/xml/TclExpat-1.1/configure (.../configure) (revision 34f178fae21c3cf3a2410c7b1986d3e6b84dcf42) @@ -10990,3 +10990,5 @@ + + Index: library/xml/TclExpat-1.1/configure.in =================================================================== diff -u -r8013b53cd7dd9e5eb6f5bc9e119556314f4922b4 -r34f178fae21c3cf3a2410c7b1986d3e6b84dcf42 --- library/xml/TclExpat-1.1/configure.in (.../configure.in) (revision 8013b53cd7dd9e5eb6f5bc9e119556314f4922b4) +++ library/xml/TclExpat-1.1/configure.in (.../configure.in) (revision 34f178fae21c3cf3a2410c7b1986d3e6b84dcf42) @@ -253,3 +253,5 @@ + + Index: tests/testx.xotcl =================================================================== diff -u -r90f13fe04f5c707be3b56808a8a7992adab1855f -r34f178fae21c3cf3a2410c7b1986d3e6b84dcf42 --- tests/testx.xotcl (.../testx.xotcl) (revision 90f13fe04f5c707be3b56808a8a7992adab1855f) +++ tests/testx.xotcl (.../testx.xotcl) (revision 34f178fae21c3cf3a2410c7b1986d3e6b84dcf42) @@ -3130,7 +3130,7 @@ ::errorCheck [Class info instances Unk*] "::UnknownClass" "no match in info instances" ::errorCheck [Class info instances Unk] "" "no match in info instances (no metachars)" ::errorCheck [Class info class] ::xotcl::Class "info class of Class" - ::errorCheck [Class info class Object] ::xotcl::Object "info class of Class Object" + ::errorCheck [Class info precedence ::xotcl::Object] ::xotcl::Object "info class of Class Object" Class C Class D -superclass C Class E -superclass D -parameter {{x 1}} @@ -3192,6 +3192,25 @@ } C c -name koen -number 25 ::errorCheck [c test] "koen 25" "instvar with alias" + + # + Class C + Class D -superclass C + Class D1 + D instmixin D1 + D d1 + + ::errorCheck [d1 info precedence] "::D1 ::D ::C ::xotcl::Object" "d1 info precedence" + ::errorCheck [d1 info precedence *] "::D1 ::D ::C ::xotcl::Object" "d1 info precedence *" + ::errorCheck [d1 info precedence ::D*] "::D1 ::D" "d1 info precedence pattern" + + ::errorCheck [d1 info precedence -intrinsic] "::D ::C ::xotcl::Object" "d1 info precedence -intrinsic" + ::errorCheck [d1 info precedence -intrinsic *] "::D ::C ::xotcl::Object" "d1 info precedence -intrinsic *" + ::errorCheck [d1 info precedence -intrinsic ::D*] "::D" "d1 info precedence -intrinsic pattern" + + d1 destroy + D destroy + D1 destroy }