Index: generic/gentclAPI.decls =================================================================== diff -u -ra47d62c39a33a69e4550eab30369560d56baf574 -r6458c13882afd52e8719ee0e0e054b42e9aee696 --- generic/gentclAPI.decls (.../gentclAPI.decls) (revision a47d62c39a33a69e4550eab30369560d56baf574) +++ generic/gentclAPI.decls (.../gentclAPI.decls) (revision 6458c13882afd52e8719ee0e0e054b42e9aee696) @@ -4,18 +4,6 @@ # same directory. It is also used by the nx::doc toolkit to generate # the authorative language reference documents. -# @package next -# -# "Next" is a compact and expressive object-oriented language -# extension for Tcl. The object system model is highly influenced by -# CLOS. This package provides the basic object system for the Next -# language. It defines the basic language entities {{@object ::nx::Object}} and -# {{@object ::nx::Class}}, as well as essential language primitives -# (e.g., {{@command ::nx::next}} and {{@command ::nx::self}}). -# -# @require Tcl -# @version 1.0.0a - # namespaces for types of methods array set ns { xotclCmd "::nsf" @@ -45,71 +33,6 @@ {-argName "arg" -required 0 -type tclobj} } -# @command ::nsf::configure -# -# A top-level configuration facility which allows you modify -# properties of the "Next" object system for the scope of an entire -# {{{interp}}}. - -# @subcommand ::nsf::configure#filter -# -# Allows turning on or off filters globally for the current -# interpreter. By default, the filter state is turned off. This -# function returns the old filter state. This filterless {{{interp}}} -# state is needed for the serializer which should introspect and stream the -# objects and classes without being affected by active filter. -# -# @param toggle Accepts either "on" or "off" -# @return The current filter activation state - -# @subcommand ::nsf::configure#softrecreate -# -# Allows controlling the scheme applied when recreating an object or a -# class. By default, it is set to {{{off}}}. This means that the -# object/class is destroyed and all relations -# (e.g. subclass/superclass) to other objects/classes are revoked as -# well. If softrecreate is set to {{{on}}}, the object is re-set, but not -# destroyed, the relations are -# kept. -# -# A "soft" recreation is important for e.g. reloading a file with -# class definitions (e.g. when used in OpenACS with file watching and -# reloading). With softrecreate set, it is not necessary to recreate -# dependent subclasses etc. Consider the example of a class hierarchy -# {{{A <- B <- C}}}. Without {{{softrecreate}}} set, a reload of -# {{{B}}} means first a destroy of B, leading to {{{A <- C}}}, and -# instances of {{{B}}} are re-classed to {{@object -# ::nx::Object}}. When softrecreate is set, the class hierarchy -# remains untouched. -# -# @param toggle Accepts either "on" or "off" -# @return The current toggle value - - -# @subcommand ::nsf::configure#objectsystems -# -# A mere introspection subcommand. It gives you the top level of the -# current object system, i.e., the ruling root class and root -# meta-class. For "Next": -# -# {{{ -# ::nsf::configure objectsystems; # returns "::nx::Object ::nx::Class" -# }}} -# -# @return The active pair of root class and root meta-class - -# @subcommand ::nsf::configure#keepinitcmd -# -# Usually, initcmd scripts are discarded by the {{{interp}}} once -# having been evaluated (in contrast to {{{proc}}} and {{{method}}} -# bodies). If you need them preserved for later introspection and -# processing (as in the "Next" documentation system), set this option -# to {{{true}}}. Then, the initcmd scripts are retained as a -# particular object variable ({{{__initcmd}}}) of classes and -# objects. It defaults to {{{false}}}. -# -# @param value:boolean Either {{{true}}} or {{{false}}} -# @return The current setting xotclCmd configure XOTclConfigureCmd { {-argName "configureoption" -required 1 -type "filter|softrecreate|objectsystems|keepinitcmd"} {-argName "value" -required 0 -type tclobj} @@ -195,22 +118,6 @@ {-argName "args" -type args} } -# @command ::nx::next -# -# Invokes the shadowed (i.e, same-named) method which is next along -# the precedence path and returns the results of this invocation. If -# {{{next}}} is called without arguments, the arguments of the current -# method (i.e., the arguments as present at the current callframe) are -# passed through to the shadowed method. If next is invoked with the -# flag --noArgs, the shadowed method is called without the active -# callframe arguments. If other arguments are specified for {{{next}}} -# explicitly, these will be passed instead. -# -# @param --noArgs:optional Deactivates the forward-passing of the current callframe's arguments -# @param args Explicitly declared arguments to pass to shadowed methods - -# TODO: shouldn't next be defined here? - xotclCmd namespace_copycmds XOTclNSCopyCmds { {-argName "fromNs" -required 1 -type tclobj} {-argName "toNs" -required 1 -type tclobj} @@ -241,31 +148,6 @@ {-argName "currentoption" -required 0 -type "proc|method|object|class|activelevel|args|activemixin|calledproc|calledmethod|calledclass|callingproc|callingmethod|callingclass|callinglevel|callingobject|filterreg|isnextcall|next"} } -# @command ::nx::current -# -# An introspective command which allows you to explore the "Next" -# callstack from within the scope of a method (or procif bound to an -# object via {{{alias}}}). {{{current}}} computes callstack related -# information. If executed without specifying a subcommand, -# i.e. {{{[current]}}}, returns the name of the object, which is -# currently in execution. If called from outside a proc, it returns -# the error message "No current object". -# -# It comes with a variety of subcommands to query different bits of -# callstack information. See below. -# -# @subcommand class Returns the name of the class holding the currently executing per-class method, if and only if called from within a per-class method. Note, that this method-owning class may be different to the class of the current object. If called from within a per-object method, it returns an empty string. -# @subcommand proc Returns the name of the currently executing method. -# @subcommand callingclass Returns the name of the class which is calling into the executing method. -# @subcommand callingobject Returns the name of the object which is calling into the executing method. -# @subcommand calledclass Returns the name of the class that holds the originally (and now shadowed) target method (applicable in mixin classes and filters). -# @subcommand calledproc Returns the name of the target method (applicable in a filter only). -# @subcommand isnextcall Returns 1 if the executing method was invoked via {{@command ::nx::next}}, 0 otherwise. -# @subcommand next Returns the name of the method next on the precedence path as a string. -# @subcommand filterreg In a method serving as active filter, returns the name of the object (class) on which the method is registered as a filter. -# @subcommand callinglevel Returns the "original" callstack level calling into the executing method. Intermediary {{{next}}} calls are ignored in this computation. The level is returned in a form so that it can be used as first argument in {{@method ::nx::Object class uplevel}} or {{@method ::nx::Object class upvar}}. -# @subcommand activelevel Returns the actual callstack level calling into the executing method. The active might correspond the {{{callinglevel}}}, but this is not necessarily the case. The {{{activelevel}}} counts {{@command ::nx::next}} call. The level is returned in a form so that it can be used as first argument in {{@method ::nx::Object class uplevel}} or {{@method ::nx::Object class upvar}}. - xotclCmd setvar XOTclSetVarCmd { {-argName "object" -required 1 -type object} {-argName "variable" -required 1 -type tclobj} @@ -277,182 +159,35 @@ {-argName "parameter" -type tclobj} } -# -# object methods -# - -# @object ::nx::Object -# -# "Next" programs are constructed out of objects. This class -# describes common structural and behavioural features for all "Next" -# objects. It is the root object-class in the "Next" object system. - -# @method ::nx::Object#autoname -# -# Provides a facility for auto-generating object identifiers. It is -# constructed from a seeding string which is appended a numeric -# index. This numeric index is incremented upon each call to -# {{{autoname}}}. -# {{{ -# set obj [Object new] -# $obj autoname a; # yields "a1" -# $obj autoname -instance B; # yields "b1" -# $obj autoname a; # yields "a2" -# $obj autoname b; # yields "b1" -# $obj autoname -reset a; # "" -# $obj autoname -reset -instance B; # "" -# $obj autoname -instance a; # yields "a1", and NOT "a3"! -# $obj autoname -instance B; # yields "b1" -# $obj autoname b; # yields "b2" -# }}} -# The seeding string may also contain {{{[format]}}} expressions (see ...): -# {{{ -# $obj autoname a%06d; # gives you "a000001", ... -# }}} -# -# @param -instance Have the generated name start with a lower letter (though the seed string has a major first letter) -# @param -reset Reset the object-internal counter for a given seed string -# @param name The seeding string which is used as a base for name generation -# @return The generated name string objectMethod autoname XOTclOAutonameMethod { {-argName "-instance"} {-argName "-reset"} {-argName "name" -required 1 -type tclobj} } -# @method ::nx::Object#cleanup -# -# TODO: this is a method not used in the Next Scripting Langauge. This -# mehtod is just called via recreate, so everything necessary can be -# performed there as well. However, it is available for backward -# compatibility available in XOTcl 2.0 -# -# Resets an object or class to its initial state, as after object -# allocation (see {{@method ::nx::Class class alloc}}). This method -# participates in recreating objects, i.e, it is called during the -# recreation process by {{@method ::nx::Class class recreate}}. -# Depending on the recreation scheme applied (see {{@command -# ::nsf::configure}}, object variables are deleted, per-object -# namespaces are cleared, and the object's relationsships (e.g., mixin -# relations) are reset. -# -# @properties interally-called objectMethod cleanup XOTclOCleanupMethod { } -# @method ::nx::Object#configure -# -# This method participates in the object creation process. It is -# automatically invoked after having produced a new object by -# {{@method ::nx::Class class create}}. -# Upon its invocation, the variable argument vector {{{args}}} -# contains a list of parameters and parameter values passed in -# from the call site of object creation. They are matched against -# an object parameter definition. This definition, and so the -# actual method parameter definition of this method, is assembled -# from configuration values of the classes along the precedence -# order (see also {{@method ::nx::Object class objectparameter}}). -# The method {{{configure}}} can be called at arbitrary times to -# "re-set" an object. -# -# @properties interally-called -# @param args The variable argument vector stores the object parameters and their values objectMethod configure XOTclOConfigureMethod { {-argName "args" -type allargs} } -# @method ::nx::Object#destroy -# -# The standard destructor for an object. The method {{@method ::nx::Object class destroy}} -# triggers the physical destruction of the object. The method {{{destroy}}} can be refined -# by subclasses or mixin classes to add additional (class specific) destruction behavior. -# Note that in most cases, the class specific {{{destroy}}} methods should call -# {{@command ::nx::next}} to trigger physical destruction. -# {{{ -# nx::Class create Foo { -# :method destroy {} { -# puts "destroying [self]" -# next -# } -# } -# Foo create f1 -# f1 destroy -# }}} -# Technical details: The method {{@method ::nx::Object class destroy}} -# delegates the actual destruction to {{@method ::nx::Class class dealloc}} -# which clears the memory object storage. Essentially, the behaviour could be -# scripted as: -# {{{ -# Object method destroy {} { -# [:info class] dealloc [self] -# } -# }}} -# Note, however, that {{{destroy}}} is protected against -# application-level redefinition. You must refine it in a subclass -# or mixin class. -# objectMethod destroy XOTclODestroyMethod { } -# @method ::nx::Object#exists -# -# A helper method for checking whether the variable {{{var}}} is -# defined on the object and assigned a value. You may use a variable -# name with or without prefix, both will resolve to the object scope: -# {{{ -# $obj eval { -# set :foo 1 -# set bar 2 -# } -# -# $obj exists foo; # returns 1 -# $obj exists :foo; # returns 1 -# $obj exists bar; # returns 0 -# $obj exists :bar; # returns 0 -# }}} -# -# @param var The name of the variable to verify -# @return :boolean 1 if the variable exists, 0 otherwise objectMethod exists XOTclOExistsMethod { {-argName "var" -required 1} } -# @method ::nx::Object#filterguard -# -# Adds conditions to guard invocations of a filter. The -# filter will only execute, if the guards evaluate to true. Otherwise, -# the guarded filter is ignored. If no guards are given, -# always execute the filter. -# -# @param filter Handle to identify and address a filter once registered -# @param guard A list of guard expressions objectMethod filterguard XOTclOFilterGuardMethod { {-argName "filter" -required 1} {-argName "guard" -required 1 -type tclobj} } -# @method ::nx::Object#filtersearch -# -# -# -# @param filter Handle to identify and address a filter once registered -# @param guard A list of guard expressions -# @return A string which describes a fully qualified method handle -#objectMethod filtersearch XOTclOFilterSearchMethod { -# {-argName "filter" -required 1} -#} - -# @method ::nx::Object#instvar -# -# @param args objectMethod instvar XOTclOInstVarMethod { {-argName "args" -type allargs} } -# @method ::nx::Object#mixinguard -# -# @param mixin -# @param guard objectMethod mixinguard XOTclOMixinGuardMethod { {-argName "mixin" -required 1} {-argName "guard" -required 1 -type tclobj} @@ -462,100 +197,27 @@ # {-argName "args" -type allargs} #} -# @method ::nx::Object#mixinguard -# -# @param mixin -# @param guard objectMethod noinit XOTclONoinitMethod { } -# @method ::nx::Object#requireNamespace -# -# This method allows you to request the creation of a namespace for -# the given object, a per-object namespace. The namespace is then used -# to store instance variables, methods and nested objects. Per-object -# namespaces are needed for using and binding object variables to -# non-object scopes in Tcl and Tk. For instance, you may use an -# per-object namespace to have object variables accessible Tk widgets -# and Tk callbacks. To verify whether a per-object namespace is -# available for an object, see ... -# -# Beware that there is a difference between per-object namespaces and -# Tcl namespaces which shadow an existing object (i.e., carry the same -# name): -# {{{ -# Object create Foo -# Foo requireNamespace -# namespace exists Foo; # returns 1 -# Foo info hasnamespace; # returns 1 -# -# Object create Bar -# namespace eval ::Bar {} -# namespace exists Bar; # returns 1 -# Bar info hasnamespace; # returns 0 -# }}} objectMethod requireNamespace XOTclORequireNamespaceMethod { } -# @method ::nx::Object#residualargs -# -# @properties interally-called -# @param args objectMethod residualargs XOTclOResidualargsMethod { {-argName "args" -type allargs} } -# @method ::nx::Object#uplevel -# -# This helper allows you to evaluate a script in the context of -# another callstack level (i.e., callstack frame). -# -# @param level:optional The starting callstack level (defaults to the value of {{{[current callinglevel]}}}) -# @param script:list The script to be evaluated in the targeted callstack level objectMethod uplevel XOTclOUplevelMethod { {-argName "args" -type allargs} } -# @method ::nx::Object#upvar -# -# This helper allows you to bind a local variable to a variable -# residing at a different callstack level (frame). -# -# @param level:optional The starting callstack level (defaults to the value of {{{[current callinglevel]}}}) -# @param sourceVar A variable which should be linked to a ... -# @param targetVar ... which is a local variable in a method scope -# @see ... objectMethod upvar XOTclOUpvarMethod { {-argName "args" -type allargs} } -# @method ::nx::Object#volatile -# -# By calling on this method, the object is bound in its lifetime to -# the one of call site (e.g., the given Tcl proc or method scope): -# {{{ -# proc foo {} { -# info vars; # shows "" -# set x [Object create Bar -volatile] -# info vars; # shows "x Bar" -# } -# }}} -# Behind the scenes, {{{volatile}}} registers a C-level variable trace -# ({{{Tcl_TraceVar()}}}) on the hiddenly created local variable (e.g., -# {{{Bar}}}), firing upon unset events and deleting the referenced -# object ({{{Bar}}}). That is, once the callframe context of {{{foo}}} -# is left, the local variable {{{Bar}}} is unset and so the bound -# object is destroyed. objectMethod volatile XOTclOVolatileMethod { } -# @method ::nx::Object#vwait -# -# A method variant of the Tcl {{{vwait}}} command. You can use it to -# have the {{{interp}}} enter an event loop until the specified -# variable {{{varname}}} is set on the object. -# -# @param varname The name of the signalling object variable. objectMethod vwait XOTclOVwaitMethod { {-argName "varname" -required 1} } @@ -589,122 +251,19 @@ # class methods # -# @object ::nx::Class -# -# A class defines a family of object types which own a common set of -# attributes (see {{@object ::nx::Attribute}}) and methods. Classes -# are organised according to their similarities and differences in -# classification hierarchies. This object represents the root -# meta-class in the "Next" object system. -# -# @superclass ::nx::doc::entities::object::nx::Object - -# @method ::nx::Class#alloc -# -# Creates a bare object or class which is not -# fully initialized. {{{alloc}}} is used by {{@method ::nx::Class class create}} to -# request a memory object storage. In subsequent steps, -# {{{create}}} invokes {{{configure}}} and {{{init}}} to further -# set up the object. Only in rare situations, you may consider -# bypassing the overall {{{create}}} mechanism by just allocating -# uninitialized objects using {{{alloc}}}. -# -# @properties interally-called -# @param name The object identifier assigned to the object storage to be allocated. -# @return The name of the allocated, uninitialized object classMethod alloc XOTclCAllocMethod { {-argName "name" -required 1 -type tclobj} } -# @method ::nx::Class#create -# -# Provides for creating application-level classes and objects. If -# the method receiver is a meta-class, a class will be -# created. Otherwise, {{{create}}} yields an object. {{{create}}} -# is responsible a multi-phase object creation scheme. This -# creation scheme involves three major steps: -# {{{ -# [Object create anObject] (1) -# ---------------. .--------------. -# -------------->|Class->create()|-->|Class->alloc()| -# `---------------' `--------------' -# | | (2) .-------------------. -# | .----->|Object->configure()| -# | `-------------------' -# | (3) .------. -# .........>|init()| -# `------' -# }}} -# (1) A call to {{@method ::nx::Class class alloc}} to create a raw, -# uninitalized object. -# -# (2) The newly allocated object receives a method call upon -# {{@method ::nx::Object class configure}}. This will establish the -# object's initial state, by applying object parameter values -# provided at object creation time and default values defined at -# object definition time. -# -# (3) Finally, {{{create}}} emits a call to the initialization -# method {{{init}}} (i.e., the actual "constructor"), if -# available. An {{{init}}} method can be defined by a class on -# behalf of its objects, to lay out class-specific initialisation -# behaviour. Alternatively, each single object may define an -# {{{init}}} method on its own. -# -# By overloading the method in a meta-class, you can refine or -# replace this default object creation scheme (e.g., for applying -# application-specific naming schemes). -# -# For creating an object or a class, you must name {{{create}}} -# explicitly, i.e.: -# {{{ -# ::nx::Object create anObject -# ::nx::Class create AClass -# ::nx::Class AnotherClass; # This fails: "Method 'AnotherClass' unknown for ::nx::Class." -# }}} -# -# @param name The designated identifier on the class or the object to be created. -# @param args Arguments to be passed down to the object creation procedure used to initialize the object. -# @return The name of the created, fully initialized object. classMethod create XOTclCCreateMethod { {-argName "name" -required 1} {-argName "args" -type allargs} } -# @method ::nx::Class#dealloc -# -# Marks objects for physical deletion in memory. Beware the fact -# that calling {{{dealloc}}} does not necessarily cause the object -# to be deleted immediately. Depending on the lifecycle of the the -# object's environment (e.g., the {{{interp}}}, the containing -# namespace) and on call references down the callstack, the actual -# memory freeing operation may occur time-shifted (that is, -# later). While {{{dealloc}}} itself cannot be redefined for -# {{{::nx::Class}}}, you may consider refining it in a subclass or -# mixin class for customizing the destruction process. -# -# @properties interally-called -# @param object The name of the object to be scheduled for deletion. classMethod dealloc XOTclCDeallocMethod { {-argName "object" -required 1 -type tclobj} } -# @method ::nx::Class#new -# -# A convenience method to create auto-named objects and classes. It is -# a front-end to {{@method ::nx::Class class create}}. For instance: -# {{{ -# set obj [Object new] -# set cls [Class new] -# }}} -# -# This will provide object identifiers of the form -# e.g. {{{::nsf::__#0}}}. In contrast to {{@method ::nx::Object class autoname}}, -# the uniqueness of auto-generated identifiers is guaranteed for the -# scope of the {{{interp}}}. -# -# @param -childof If provided, the new object is created as a child of the specified object. -# @param args The variable arguments passed down to {{@method ::nx::Class class create}}. classMethod new XOTclCNewMethod { {-argName "-childof" -type object -nrargs 1} {-argName "args" -required 0 -type args} @@ -718,40 +277,6 @@ {-argName "guard" -required 1 -type tclobj} } -# @method ::nx::Class#recreate -# -# This method is called upon recreating an object. Recreation is the -# scheme for resolving object naming conflicts in the dynamic and -# scripted programming environment of "Next": An object or class is -# created while an object or class with an identical object identifier -# already exists. The method {{{recreate}}} performs standard object -# initialization, per default, after re-setting the state and -# relationships of the object under recreation. This re-set is -# achieved by invoking {{@method ::nx::Object class cleanup}}. -# {{{ -# Object create Bar -# \# ... -# Object create Bar; # calls Object->recreate(::Bar, ...) + ::Bar->cleanup() -# }}} -# By refining {{{recreate}}} in an application-level subclass or mixin -# class, you can intercept the recreation process. In the pre-part the -# refined {{{recreate}}} method, the recreated object has its old -# state, after calling {{@command ::nx::next}} it is cleaned up. -# -# If the name conflict occurs between an existing class and a newly -# created object (or vice versa), {{{recreate}}} is not -# performed. Rather, a sequence of {{@method ::nx::Object class destroy}} -# and {{@method ::nx::Class class create}} is triggered: -# {{{ -# Object create Bar -# \# ... -# Class create Bar; # calls Bar->destroy() + Class->create(::Bar, ...) -# }}} -# -# @properties interally-called -# @param name The name (identifier) of the object under recreation -# @param args Arbitrary vector of arguments -# @return The name of the recreated object classMethod recreate XOTclCRecreateMethod { {-argName "name" -required 1 -type tclobj} {-argName "args" -type allargs} Index: generic/predefined.tcl =================================================================== diff -u -r6a0e62b53f8b405d11f009e3c0acb2098702d921 -r6458c13882afd52e8719ee0e0e054b42e9aee696 --- generic/predefined.tcl (.../predefined.tcl) (revision 6a0e62b53f8b405d11f009e3c0acb2098702d921) +++ generic/predefined.tcl (.../predefined.tcl) (revision 6458c13882afd52e8719ee0e0e054b42e9aee696) @@ -1,20 +1,268 @@ namespace eval ::nsf { - # # get frequenly used primitiva into the ::nsf namespace # # Symbols reused in the next scripting language + + # @command assertion + # + # @param object:object + # @param assertionsubcmd:required + # @param arg + + # @command existsvar + # + # @param object:object + # @param var + + # @command methodproperty + # + # @param object:object + # @param -per-object:switch + # @param methodName + # @param methodproperty Accepts one of: {{{protected}}}, {{{redefine-protected}}}, {{{returns}}}, {{{slotobj}}} + # @param value + + # @command setter + # + # @param object:object + # @param -per-object:switch + # @param parameter + + # @command createobjectsystem + # + # @param rootClass + # @param rootMetaClass + # @param systemMethods:optional + + # @command dispatch + # + # @param object:object + # @param -objscope + # @param command + # @param args + + # @command deprecated + # + # @param what + # @param oldCmd + # @param newCmd:optional + + # @command objectproperty + # + # @param object:object + # @param objectkind Accepts one of: {{{type}}}, {{{object}}}, {{{class}}}, {{{baseclass}}}, {{{metaclass}}}, {{{hasmixin}}} + # @param value:optional + + # @command importvar + # + # @param object:object + # @param args + + # @command parametercheck + # + # @param -nocomplain + # @param param + # @param value:optional + + # @command forward + # + # @param object:object + # @param -per-object:switch + # @param method + # @param -default + # @param -earlybinding:switch + # @param -methodprefix + # @param -objscope:switch + # @param -onerror + # @param -verbose:switch + # @param target + # @param args + + # @command setvar + # + # @param object:object + # @param variable + # @param value + + # @command method + # + # @param object:object + # @param -inner-namespace + # @param -per-object + # @param -public + # @param name + # @param args + # @param body + # @param -percondition + # @param -postcondition + + # @command next + # + # Invokes the shadowed (i.e, same-named) method which is next along + # the precedence path and returns the results of this invocation. If + # {{{next}}} is called without arguments, the arguments of the current + # method (i.e., the arguments as present at the current callframe) are + # passed through to the shadowed method. If next is invoked with the + # flag --noArgs, the shadowed method is called without the active + # callframe arguments. If other arguments are specified for {{{next}}} + # explicitly, these will be passed instead. + # + # @param --noArgs:optional Deactivates the forward-passing of the current callframe's arguments + # @param args Explicitly declared arguments to pass to shadowed methods + + + # @command current + # + # An introspective command which allows you to explore the "Next" + # callstack from within the scope of a method (or procif bound to an + # object via {{{alias}}}). {{{current}}} computes callstack related + # information. If executed without specifying a subcommand, + # i.e. {{{[current]}}}, returns the name of the object, which is + # currently in execution. If called from outside a proc, it returns + # the error message "No current object". + # + # It comes with a variety of subcommands to query different bits of + # callstack information. See below. + # + # @subcommand class Returns the name of the class holding the currently executing per-class method, if and only if called from within a per-class method. Note, that this method-owning class may be different to the class of the current object. If called from within a per-object method, it returns an empty string. + # @subcommand proc Returns the name of the currently executing method. + # @subcommand callingclass Returns the name of the class which is calling into the executing method. + # @subcommand callingobject Returns the name of the object which is calling into the executing method. + # @subcommand calledclass Returns the name of the class that holds the originally (and now shadowed) target method (applicable in mixin classes and filters). + # @subcommand calledproc Returns the name of the target method (applicable in a filter only). + # @subcommand isnextcall Returns 1 if the executing method was invoked via {{@command ::nx::next}}, 0 otherwise. + # @subcommand next Returns the name of the method next on the precedence path as a string. + # @subcommand filterreg In a method serving as active filter, returns the name of the object (class) on which the method is registered as a filter. + # @subcommand callinglevel Returns the "original" callstack level calling into the executing method. Intermediary {{{next}}} calls are ignored in this computation. The level is returned in a form so that it can be used as first argument in {{@method ::nx::Object class uplevel}} or {{@method ::nx::Object class upvar}}. + # @subcommand activelevel Returns the actual callstack level calling into the executing method. The active might correspond the {{{callinglevel}}}, but this is not necessarily the case. The {{{activelevel}}} counts {{@command ::nx::next}} call. The level is returned in a form so that it can be used as first argument in {{@method ::nx::Object class uplevel}} or {{@method ::nx::Object class upvar}}. + namespace export next current # Symbols reused in XOTcl + + # @command configure + # + # A top-level configuration facility which allows you modify + # properties of the "Next" object system for the scope of an entire + # {{{interp}}}. + + # @subcommand configure#filter + # + # Allows turning on or off filters globally for the current + # interpreter. By default, the filter state is turned off. This + # function returns the old filter state. This filterless {{{interp}}} + # state is needed for the serializer which should introspect and stream the + # objects and classes without being affected by active filter. + # + # @param toggle Accepts either "on" or "off" + # @return The current filter activation state + + # @subcommand configure#softrecreate + # + # Allows controlling the scheme applied when recreating an object or a + # class. By default, it is set to {{{off}}}. This means that the + # object/class is destroyed and all relations + # (e.g. subclass/superclass) to other objects/classes are revoked as + # well. If softrecreate is set to {{{on}}}, the object is re-set, but not + # destroyed, the relations are + # kept. + # + # A "soft" recreation is important for e.g. reloading a file with + # class definitions (e.g. when used in OpenACS with file watching and + # reloading). With softrecreate set, it is not necessary to recreate + # dependent subclasses etc. Consider the example of a class hierarchy + # {{{A <- B <- C}}}. Without {{{softrecreate}}} set, a reload of + # {{{B}}} means first a destroy of B, leading to {{{A <- C}}}, and + # instances of {{{B}}} are re-classed to {{@object + # ::nx::Object}}. When softrecreate is set, the class hierarchy + # remains untouched. + # + # @param toggle Accepts either "on" or "off" + # @return The current toggle value + + + # @subcommand configure#objectsystems + # + # A mere introspection subcommand. It gives you the top level of the + # current object system, i.e., the ruling root class and root + # meta-class. For "Next": + # + # {{{ + # configure objectsystems; # returns "::nx::Object ::nx::Class" + # }}} + # + # @return The active pair of root class and root meta-class + + # @subcommand configure#keepinitcmd + # + # Usually, initcmd scripts are discarded by the {{{interp}}} once + # having been evaluated (in contrast to {{{proc}}} and {{{method}}} + # bodies). If you need them preserved for later introspection and + # processing (as in the "Next" documentation system), set this option + # to {{{true}}}. Then, the initcmd scripts are retained as a + # particular object variable ({{{__initcmd}}}) of classes and + # objects. It defaults to {{{false}}}. + # + # @param value:boolean Either {{{true}}} or {{{false}}} + # @return The current setting + + # @command alias + # + # @param object:object The target object which becomes the owner of the aliased command (method, object or command). + # @param -per-object:switch If the target object is a class, one can specify the binding scope (i.e., per-object or per-class) of the aliased command + # @param methodName The name of the alias. + # @param -nonleaf:switch ... + # @param -objscope:switch ... + # @param cmdName The alias source as a command handle (as returned by ...) + + # @command finalize + + # @command interp + # + # @param name + # @param args + + # @command is + # + # @param value + # @param constraint + # @param -hasmixin + # @param -type + # @param arg + + # @command my + # + # @param -local + # @param method + # @param args + + # @command relation + # + # @param object + # @param relationtype + # @param value + namespace export alias configure finalize interp is my relation # # support for method provide and method require # + + # @command provide_method + # + # @param require_name + # @param definition + # @param script:optional + proc ::nsf::provide_method {require_name definition {script ""}} { set ::nsf::methodIndex($require_name) [list definition $definition script $script] } + # @command require_method + # + # @param object + # @param name + # @param per_object proc ::nsf::require_method {object name {per_object 0}} { set key ::nsf::methodIndex($name) if {[info exists $key]} { @@ -38,6 +286,11 @@ # # provide a similar interface as for ::nsf::method, ::nsf::alias, ... # + + # @command mixin + # + # @param object + # @param args proc ::nsf::mixin {object args} { if {[lindex $args 0] eq "-per-object"} { set rel "object-mixin" @@ -83,6 +336,11 @@ # # determine platform aware temp directory # + + # @command tmpdir + # + # @return The platform-specific path name to the system-wide temporary directory + proc tmpdir {} { foreach e [list TMPDIR TEMP TMP] { if {[info exists ::env($e)] \ Index: library/lib/doc-assets/api.css =================================================================== diff -u -r783648c4c7132adc4a447faa69d6e4e12b621c46 -r6458c13882afd52e8719ee0e0e054b42e9aee696 --- library/lib/doc-assets/api.css (.../api.css) (revision 783648c4c7132adc4a447faa69d6e4e12b621c46) +++ library/lib/doc-assets/api.css (.../api.css) (revision 6458c13882afd52e8719ee0e0e054b42e9aee696) @@ -105,6 +105,9 @@ #doc3 .section.details .description dt { font-weight: bold; } #doc3 .section.details .description td { border:1px solid #ccc; margin:2px;padding:2px;} +#doc3 .members { padding:10px; border:1px solid #98AAB1; } +#doc3 .members h4 { font-size: 100%;} + #doc3 .inheritance { padding:10px; background-color:#ECF0F6; border:1px solid #98AAB1; } #doc3 .inheritance h4 { font-size: 100%;} Index: library/lib/doc-assets/command.html.tmpl =================================================================== diff -u -r8aaec98df564488dc8540cd078d6a32dd55a08f7 -r6458c13882afd52e8719ee0e0e054b42e9aee696 --- library/lib/doc-assets/command.html.tmpl (.../command.html.tmpl) (revision 8aaec98df564488dc8540cd078d6a32dd55a08f7) +++ library/lib/doc-assets/command.html.tmpl (.../command.html.tmpl) (revision 6458c13882afd52e8719ee0e0e054b42e9aee696) @@ -13,10 +13,26 @@

Subcommands

+
+
+ + [:for sub ${:@subcommand} { + + [$sub name] + + }] + +
+
+
[:for sub ${:@subcommand} {
-

[$sub name] +

[$sub name]

[:? {[$sub eval {info exists :@return}] && [[$sub @return] spec] ne ""} {<[[$sub @return] spec]>} ] Index: library/lib/doc-assets/entity.html.tmpl =================================================================== diff -u -r89b5047e54e47a88a7de75d8523a07ffa5743407 -r6458c13882afd52e8719ee0e0e054b42e9aee696 --- library/lib/doc-assets/entity.html.tmpl (.../entity.html.tmpl) (revision 89b5047e54e47a88a7de75d8523a07ffa5743407) +++ library/lib/doc-assets/entity.html.tmpl (.../entity.html.tmpl) (revision 6458c13882afd52e8719ee0e0e054b42e9aee696) @@ -55,14 +55,14 @@
This is the API documentation for the [:name] project. -

Choose a package or object name from the list for more information.

+

Choose a package, object or command name from the list for more information.

}]