Index: ChangeLog =================================================================== diff -u -r71d7231ca9527ae6812043718df1d4e07e1a1a41 -rc2f6b67e7b36f9b7f9e69362420ce572847df18e --- ChangeLog (.../ChangeLog) (revision 71d7231ca9527ae6812043718df1d4e07e1a1a41) +++ ChangeLog (.../ChangeLog) (revision c2f6b67e7b36f9b7f9e69362420ce572847df18e) @@ -1,13 +1,25 @@ +2008-02-22: + * Release of XOTcl 1.6-0 + +2008-02-22: + * Update of documentation + 2008-02-21: + * Clear XOTCL_MIXIN_ORDER_VALID flag unconditionally + in MixinInvalidateObjOrders() for mixins (Neophytos + had problems in naviserver; many thanks for reporting!) - * replaced Tcl_ObjSetVar2() with Tcl_SetVar2Ex() in nonposargs, +2008-02-21: + + * Replaced Tcl_ObjSetVar2() with Tcl_SetVar2Ex() in nonposargs, since Tcl 8.5 seemed to optimize local variables away, if these - not referenced directly from from Tcl, + not referenced directly from from Tcl. - Tcl 8.5 seems to optimize variables away, which are not directly - referenced by the Tcl proc body. In the following example, "ot" - is set from C (via nonposargs, previously via Tcl_ObjSetVar2()) - and consumed via C (from the db-driver, using :ot). + Tcl 8.5 seems to optimize proc-local variables away, which are not + directly referenced by the Tcl proc body. In the following + example, "ot" is set from C (via nonposargs, previously via + Tcl_ObjSetVar2()) and consumed via C (from the db-driver, using + :ot). SomeClass instproc foo {-ot} { #ns_log notice ot=$ot Index: doc/langRef.xotcl =================================================================== diff -u -r0af82d91e55016bf2a42c7a171e65e7e4a0e0e04 -rc2f6b67e7b36f9b7f9e69362420ce572847df18e --- doc/langRef.xotcl (.../langRef.xotcl) (revision 0af82d91e55016bf2a42c7a171e65e7e4a0e0e04) +++ doc/langRef.xotcl (.../langRef.xotcl) (revision c2f6b67e7b36f9b7f9e69362420ce572847df18e) @@ -1,5 +1,5 @@ # $Id: langRef.xotcl,v 1.18 2007/09/05 19:09:22 neumann Exp $ -package provide XOTcl-langRef 1.5.5 +package provide XOTcl-langRef 1.6.0 package require XOTcl @ @File { @@ -242,15 +242,22 @@ Calls the '-' (dash) methods. I.e. evaluates arguments and calls everything starting with '-' (and not having a digit a second char) as a method. Every list element until the next '-' - is interpreted as a method argument. configure/tt> is called - before the constructor during initialization and recreation. + is interpreted as a method argument. configure is called + before the constructor init during initialization and recreation. In the following example, the variable set is called via configure before init: <@pre class='code'> Object o -set x 4 The method configure can be called with the dash-notation at arbitrary times: <@pre class='code'> o configure -set x 4 - } + + Note, that if '-' is followed by a numerical, the arument is + interpreted as a negative number (and not as a method). If a + value of a method called this way starts with a "-", the call can + be placed safely into a list (e.g. "Class c [list -strangearg -a-] + -simplearg 2"). +

See also create. + } return "number of the skipped first arguments" } @@ -543,9 +550,14 @@ <@TT>-nocmds only returns procs. Modifier <@TT>-nomixins excludes search on mixins. - <@li><@TT>objName info mixin: Returns the list of mixins - of the object. With <@TT>-order modifier the order of mixins - (whole hierarchy) is printed. + <@li><@TT>objName info mixin ?-order? ?-guard? ?pattern?: + Returns the list of mixins of the object. With <@TT>-order + modifier the order of mixins (whole hierarchy) is printed. If + <@TT>-guard is specified, the mixin guards are returned. + If <@TT>pattern is specified and it contains wildcards, + all matching mixins are returned. If <@TT>pattern does not + contain wildcards, either the fully qualified name is returned, + or empty, if no match exists. <@li><@TT>objName info nonposargs methodName: Returns non-positional arg list of methodName @@ -915,13 +927,16 @@ ?args? "arguments passed to the new class after creation" } { description { - Allocate memory for a new XOTcl object or class. <@tt>create<@/tt> uses - <@tt>alloc to allocate memory. But <@tt>create<@/tt> also - calls init and evaluates '-' arguments as method calls. - In seldom cases the programmer may want to suppress the - <@tt>create<@/tt> - mechanism and just allocate memory. Then <@tt>alloc can - be used. + + Allocate an uninitialized XOTcl object or class. Alloc is used by + the method <@tt>create<@/tt> to + allocate the object. Note that <@tt>create<@/tt> also calls as + well configure and init to initialized the + object. Only in seldom cases the programmer may want to suppress + the <@tt>create<@/tt> mechanism and just allocate uninitiaized + objects via <@tt>alloc<@/tt>. + } return "new class name" } @@ -942,19 +957,40 @@ Create user-defined classes or objects. If the class is a meta-class, a class is created, otherwise an object. + The method <@tt>create<@/tt> is responsible for allocating and + initializing objects. The method can be overloaded e.g. in a + metaclass if other initialization behavior is wanted. +

+ The standard behavior of <@tt>create<@/tt> is as follows: +

    + +
  1. Call the method <@tt>alloc<@/tt> to + create an uninitialized object. + +
  2. Call the method <@tt>searchDefaults<@/tt> to set default + values for instance attributes- + +
  3. Call the method <@tt>configure<@/tt> to + configure the object with the values provided at object creation + time. The method <@tt>configure<@/tt> interprets the arguments + with leading dashes as method calls. + +
  4. Call the method <@tt>init<@/tt> to + allow initialization by the class. The argument passed to init are the + values from the passed argument list containing the arguments up to the first '-'.<@p> + +
+

Create firstly calls <@tt>alloc in order to allocate memory for the new object. Then default values for parameters are searched on - superclasses (an set if found). Then <@tt>args is searched for args - starting with '-' followed by an alpha character. These arguments - are called as methods. '-' followed by a numerical is interpreted - as a negative number (and not as a method). If a value of a method - called this way starts with a "a", the call can be placed safely - into a list (e.g. "Class c [list -strangearg -a-] -simplearg 2"). + superclasses (an set if found). Finally the constructor <@tt>init is called on the object with all arguments up to the first '-' arg.<@p> - The <@tt>create method is called implicitly through the + The <@tt>create method is often called implicitly through the <@tt>unknown mechanism when a class (meta-class) is called with an unknown method. E.g. the following two commands are equivalent @@ -999,9 +1035,14 @@ of the class hierarchy. If pattern is specified, only matching values are returned. - <@li><@TT>ClassName info instances ?pattern?: - Returns a list of the instances of the class. - If pattern is specified, only matching values are returned. + <@li><@TT>ClassName info instances ?-closure? ?pattern?: + Returns a list of the instances of the class. If + <@TT>-closure is specified, the resultet contains as well + the instances of subclasses. If <@TT>pattern is specified + and it contains wildcards, all matching instances are + returned. If <@TT>pattern does not contain wildcards, + either the fully qualified name is returned, or empty, if no + match exists. <@li><@TT>ClassName info instargs method: Returns the arguments of the specified instproc (instance method). @@ -1029,9 +1070,24 @@ <@li><@TT>ClassName info instinvar: Returns class invariants. - <@li><@TT>ClassName info instmixin: - Returns the list of instmixins of this class. + <@li><@TT>ClassName info instmixin ?pattern?: Returns the + list of instmixins of this class. If <@TT>pattern is + specified and it contains wildcards, all matching mixin classes are + returned. If <@TT>pattern does not contain wildcards, + either the fully qualified name is returned, or empty, if no + match exists. + <@li><@TT>ClassName info instmixinof ?-closure? ?pattern?: + Returns the list of classes, into which this class was mixed in + via instmixin. This is the inverse function of <@TT>ClassName + info instmixin. If <@TT>-closure<@TT> is specified, also + the classes are returned, for which the class is indirectly + mixed in via instmixin. If <@TT>pattern is specified and + it contains wildcards, all matching mixin classes are + returned. If <@TT>pattern does not contain wildcards, + either the fully qualified name is returned, or empty, if no + match exists. + <@li><@TT>ClassName info instnonposargs methodName: returns list of non-positional args of methodName @@ -1045,18 +1101,35 @@ Returns all instprocs defined for the class. If pattern is specified it returns all instprocs that match the pattern. + <@li><@TT>ClassName info mixinof ?pattern?: + Returns the list of classes, into which this class was mixed in + via per object mixin. This is the inverse function of <@TT>Object + info mixin. If <@TT>pattern is specified and + it contains wildcards, all matching mixin classes are + returned. If <@TT>pattern does not contain wildcards, + either the fully qualified name is returned, or empty, if no + match exists. + <@li><@TT>ClassName info parameter: Returns parameter list. - <@li><@TT>ClassName info subclass ?subclassname?: - Returns a list of all subclasses of the class, if subclassname - was not specified, otherwise it returns 1 if subclassname is a - subclass and 0 if not. + <@li><@TT>ClassName info subclass ?-closure? ?pattern?: + Returns a list of all subclasses of the class. If + <@TT>-closure is specified, the result contains as well + the subclasses of the subclasses. If <@TT>pattern is + specified and it contains wildcards, all matching subclasses are + returned. If <@TT>pattern does not contain wildcards, + either the fully qualified name is returned, or empty, if no + match exists. - <@li><@TT> ClassName info superclass ?superclassname?: - Returns a list of all super-classes of the class, - if superclassname was not specified, otherwise it returns - 1 if superclassname is a superclass and 0 if not. + <@li><@TT> ClassName info superclass ?-closure? ?superclassname?: + Returns a list of all super-classes of the class. If + <@TT>-closure is specified, the result contains as well + the superclasses of the superclasses. If <@TT>pattern is + specified and it contains wildcards, all matching superclasses are + returned. If <@TT>pattern does not contain wildcards, + either the fully qualified name is returned, or empty, if no + match exists. <@/ul> } return "Value of introspected option as a string." Index: doc/tutorial.html =================================================================== diff -u -rc72f9f638677608fab1502cd696c8f2d6b2952f9 -rc2f6b67e7b36f9b7f9e69362420ce572847df18e --- doc/tutorial.html (.../tutorial.html) (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) +++ doc/tutorial.html (.../tutorial.html) (revision c2f6b67e7b36f9b7f9e69362420ce572847df18e) @@ -4,7 +4,7 @@ XOTcl - Tutorial - +