Index: doc/langRef.xotcl
===================================================================
diff -u -r46f02e4868e118466d888b35d6b281b3f2ba31ac -r2111020b49da8ce57758e51accf0b6073037f0d2
--- doc/langRef.xotcl (.../langRef.xotcl) (revision 46f02e4868e118466d888b35d6b281b3f2ba31ac)
+++ doc/langRef.xotcl (.../langRef.xotcl) (revision 2111020b49da8ce57758e51accf0b6073037f0d2)
@@ -1,5 +1,5 @@
# $Id: langRef.xotcl,v 1.14 2006/10/04 20:40:23 neumann Exp $
-package provide XOTcl-langRef 1.5.2
+package provide XOTcl-langRef 1.6.0
package require XOTcl
@ @File {
@@ -113,18 +113,39 @@
with class definitions (e.g. when used in OpenACS with file watching and
reloading). With <@tt>softrecreate@tt> set,
it is not necessary to recreate dependent subclasses etc.
-
+
Example: e.g. there is a class hierarchy A <- B <- C Without <@tt>softrecreate@tt> set, a reload of B means first a destroy of B, leading to A <- C, and instances of B are re-classed to ::xotcl::Object. When <@tt>softrecreate@tt> is set, the structure remains unchanged.
+ This command has the only purpose to delete all objects and classes + of an interpreter in a multi-threaded environment at a safe time. +
+ Background: when XOTcl is used in a threaded environment such as + for example in AOLserver, one has to take care that the deletion + of objects and classes happens in a safe environment, where the + XOTcl destructors (destroy methods) are still able to + run. Without ::xotcl::finalize the deletion happens in + Tcl_FinalizeThread(), after thread cleanup (where e.g. the + thread local storage is freed). This can lead to memory leaks in + AOLserver, which allocates e.g. some structures on demand, but + since this happens after cleanup, it will leak. A simple ns_log + in a destructor might lead to this problem. The solution is to + call ::xotcl::finalize in the "delete trace" in AOLserver (as it + happens in OpenACS). +
+ Note, that ::xotcl::finalize is not intended for application programs. +
See also create. + } return "number of the skipped first arguments" } @@ -515,10 +543,8 @@ <@li><@TT>objName info body method@TT>: Returns the body of the specified proc (object specific method). - <@li><@TT>objName info class ?classname?@TT>: - 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@TT>: + Returns the name of the class of the current object. <@li><@TT>objName info children ?pattern?@TT>: Returns the list of aggregated objects with fully qualified names if @@ -543,10 +569,14 @@ <@li><@TT>objName info filterguard name@TT>: Returns the guards for filter identified by name. - <@li><@TT>objName info forward ?-definition? name@TT>: Checks, - whether <@TT>name<@/TT> is a forwarder (accepts wild chard characters). - When <@TT>-definition@/TT> is specified, it returns the definition - of the forwarder. + <@li><@TT>objName info forward ?-definition name? ?pattern?@TT>: + Returns the list of forwarders. One can call this method either + without the optional arguments, or with the <@TT>pattern@TT> + or with <@TT>-definition name@TT>. When the <@TT>pattern@TT> is specified + only the matching forwarders are returned. When the <@TT>definition@TT> + option is used together with a name of a forwarder, the definition + of the forwarder with all flags is returned in a way that + can be used e.g. for registering the forwarder on another object. <@li><@TT>objName info hasNamespace@TT>: From XOTcl version 0.9 on, namespaces @@ -567,16 +597,26 @@ <@TT>-nocmds@TT> only returns procs. Modifier <@TT>-nomixins@TT> excludes search on mixins. - <@li><@TT>objName info mixin@TT>: Returns the list of mixins - of the object. With <@TT>-order@TT> modifier the order of mixins - (whole hierarchy) is printed. + <@li><@TT>objName info mixin ?-order? ?-guard? ?pattern?@TT>: + Returns the list of mixins of the object. With <@TT>-order@TT> + modifier the order of mixins (whole hierarchy) is printed. If + <@TT>-guard@TT> is specified, the mixin guards are returned. + If <@TT>pattern@TT> is specified and it contains wildcards, + all matching mixins are returned. If <@TT>pattern@TT> does not + contain wildcards, either the fully qualified name is returned, + or empty, if no match exists. <@li><@TT>objName info mixinguard name@TT>: Returns the guards for the mixin identified by name. <@li><@TT>objName info nonposargs methodName@TT>: Returns non-positional arg list of methodName + <@li><@TT>objName info parametercmd ?pattern?@TT>: + Returns a list of registered parametercmds the object + (or empty if there are none). If <@TT>pattern@TT> + is specified, only the matching parametercmds are returned. + <@li><@TT>objName info parent@TT>: Returns parent object name (or "::" for no parent), in fully qualified form. @@ -591,9 +631,11 @@ defined for the object if <@TT>pattern@TT> was not specified, otherwise it returns all procs that match the pattern. - <@li><@TT>objName info precedence ?pattern?@TT>: Returns all + <@li><@TT>objName info precedence ?-intrinsic? ?pattern?@TT>: 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@TT> 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 @@ -942,13 +984,16 @@ ?args? "arguments passed during creation" } { description { - Allocate (create) an uninitialized object or class. Typically, alloc - is called automatically by <@tt>create<@/tt> - to allocate an uninitialized object or class. - In contrast to alloc, <@tt>create<@/tt> also - initializes and configures the object. - The method alloc can be used by a programmer who may want to - create uninitialized objects/classes. + + 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 "fully qualified name of created instance" } @@ -981,10 +1026,34 @@ with all arguments up to the first '-' argument (as returned by configure). -
In the default XOTcl definition, the <@tt>create@tt> method - is called implicitly by the <@tt>unknown@tt> method of the metaclass - Class, when a class (meta-class) is called with an unknown + 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: +
+ superclasses (an set if found). + The <@tt>create@tt> method is often called implicitly through the method. E.g. the following two commands are equivalent <@pre class='code'> @@ -1028,9 +1097,14 @@ of the class hierarchy. If pattern is specified, only matching values are returned. - <@li><@TT>ClassName info instances ?pattern?@TT>: - 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?@TT>: + Returns a list of the instances of the class. If + <@TT>-closure@TT> is specified, the resultet contains as well + the instances of subclasses. If <@TT>pattern@TT> is specified + and it contains wildcards, all matching instances are + returned. If <@TT>pattern@TT> does not contain wildcards, + either the fully qualified name is returned, or empty, if no + match exists. <@li><@TT>ClassName info instargs method@TT>: Returns the arguments of the specified instproc (instance method). @@ -1055,23 +1129,47 @@ <@li><@TT>ClassName info instfilterguard name@TT>: Returns the guards for instfilter identified by name. - <@li><@TT>ClassName info instforward ?-definition? name@TT>: Checks, - whether <@TT>name<@/TT> is a forwarder (accepts wild chard characters). - When <@TT>-definition@/TT> is specified, it returns the definition - of the forwarder. + <@li><@TT>objName info instforward ?-definition name? ?pattern?@TT>: + Returns the list of instforwarders. One can call this method either + without the optional arguments, or with the <@TT>pattern@TT> + or with <@TT>-definition name@TT>. When the <@TT>pattern@TT> is specified + only the matching instforwarders are returned. When the <@TT>definition@TT> + option is used together with a name of a isntforwarder, the definition + of the instforwarder with all flags is returned in a way that + can be used e.g. for registering the instforwarder on another class. <@li><@TT>ClassName info instinvar@TT>: Returns class invariants. - <@li><@TT>ClassName info instmixin@TT>: - Returns the list of instmixins of this class. + <@li><@TT>ClassName info instmixin ?pattern?@TT>: Returns the + list of instmixins of this class. If <@TT>pattern@TT> is + specified and it contains wildcards, all matching mixin classes are + returned. If <@TT>pattern@TT> does not contain wildcards, + either the fully qualified name is returned, or empty, if no + match exists. + <@li><@TT>ClassName info instmixinof ?-closure? ?pattern?@TT>: + Returns the list of classes, into which this class was mixed in + via instmixin. This is the inverse function of <@TT>ClassName + info instmixin@TT>. If <@TT>-closure@TT> is specified, also + the classes are returned, for which the class is indirectly + mixed in via instmixin. If <@TT>pattern@TT> is specified and + it contains wildcards, all matching mixin classes are + returned. If <@TT>pattern@TT> does not contain wildcards, + either the fully qualified name is returned, or empty, if no + match exists. + <@li><@TT>ClassName info isntmixinguard name@TT>: Returns the guards for the instmixin identified by name. <@li><@TT>ClassName info instnonposargs methodName@TT>: returns list of non-positional args of methodName + <@li><@TT>objName info instparametercmd ?pattern?@TT>: + Returns a list of registered instparametercmds the class + (or empty if there are none). If <@TT>pattern@TT> + is specified, only the matching instparametercmds are returned. + <@li><@TT>ClassName info instpost methodName@TT>: Returns post assertions of methodName. @@ -1082,22 +1180,37 @@ Returns all instprocs defined for the class. If pattern is specified it returns all instprocs that match the pattern. + <@li><@TT>ClassName info mixinof ?-closure? ?pattern?@TT>: 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@TT>. If <@TT>-closure@TT> is specified, also the + classes are returned, for which the class is indirectly mixed in + as a per-object mixin. If <@TT>pattern@TT> is specified and + it contains wildcards, all matching mixin classes are + returned. If <@TT>pattern@TT> does not contain wildcards, + either the fully qualified name is returned, or empty, if no + match exists. + <@li><@TT>ClassName info parameter@TT>: Returns parameter list. - <@li><@TT>ClassName info subclass ?subclassname?@TT>: - 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?@TT>: + Returns a list of all subclasses of the class. If + <@TT>-closure@TT> is specified, the result contains as well + the subclasses of the subclasses. If <@TT>pattern@TT> is + specified and it contains wildcards, all matching subclasses are + returned. If <@TT>pattern@TT> does not contain wildcards, + either the fully qualified name is returned, or empty, if no + match exists. - <@li><@TT> ClassName info superclass ?superclassname?@TT>: - 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 slots@TT>: - Returns the slot objects defined for this class. - + <@li><@TT> ClassName info superclass ?-closure? ?superclassname?@TT>: + Returns a list of all super-classes of the class. If + <@TT>-closure@TT> is specified, the result contains as well + the superclasses of the superclasses. If <@TT>pattern@TT> is + specified and it contains wildcards, all matching superclasses are + returned. If <@TT>pattern@TT> 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."