disposition.test

Clone Tools
  • last updated 1 hour ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
- removed some TODOs from tests/parameters.test

- parameter dispositions:

We differentiate now between "initcmd" and "cmd": an "initcmd" is only

evaluated once, but one can provide configure values for this parameter

later. a "cmd" is executed on every evaluation, it is only possible

to pass cmds to it. The trailing argument of the configure parameters

(used e.g. for scripted object/class definitions) is now of type "cmd".

Implementation not yet complete (object cases are not correct).

  1. … 8 more files in changeset.
- syntax formatter: use /value/ for denoting placeholder in "... info method syntax ..."

  1. … 11 more files in changeset.
Object-method Reform: - changed interface to object specific commands by requiring an ensemble named "object". The rational behind is essentially to use always the same info command to retrieve object specific methods, no matter whether these are defined on a plain object or an a class object (does not break the "contract" what e.g. "info method" returns).

Now we define methods via:

/cls/ method foo {args} {...body...}

/cls/ object method foo {args} {...body...}

/obj/ object method foo {args} {...body...}

Similarly, aliases, forwards and mixins are defined, e.g.

/cls/ mixin add ...

/cls/ object mixin add ...

/obj/ object mixin add ...

/obj/ require object method ...

The same change propagated as well to the "info" method.

Now we have:

/cls/ info methods ...

/cls/ info object methods ...

/obj/ info object methods ...

Similar, the object parametererization uses

/cls/ create obj -object-mixin M

/cls/ create obj -object-filter f

/metacls/ create cls -mixin M1 -object-mixin M2

/metacls/ create cls -filter f1 -object-filter f2

- as a consequence,

a) "/cls/ class method ...",

"/cls/ class alias ...",

"/cls/ class forward ...",

"/cls/ class filter ...",

"/cls/ class mixin ...",

"/cls/ class info ..."

"/obj/ class method require method ..."

"/obj/ class method require public method ..."

"/obj/ class method require protected method ..."

"/obj/ class method require private method ..."

were dropped

b) "/obj/ method ....",

"/obj/ alias ....",

"/obj/ forward ...."

"/obj/ filter ...."

"/obj/ mixin ...."

"/obj/ info method*"

"/cls/ create obj -mixin M"

"/cls/ create obj -filter f"

"/obj/ method require method ..."

"/obj/ method require public method ..."

"/obj/ method require protected method ..."

"/obj/ method require private method ..."

were dropped

- added package nx::class to allow optionally the "class" notation

"/cls/ class method ..." (and friends, see (a)), and

"/cls/ class info ...

- added package nx::plain-object-method to allow optionally plain method

b) "/obj/ method ...." (and friends, see (b))

- add support to slots to use ensemble methods as setters

  1. … 43 more files in changeset.
nsf.c: - factored out ParameterMethodForwardDispatch() to call a parameter method defined as a forwarder the smae way from "configure" and "cget" - extended regression test

  1. … 3 more files in changeset.
- rename invalidateobjectparameter -> parameter:invalidate::classcache - rename invalidateobjobjectparameter -> parameter:invalidate::objectcache - bring cmds into alphabetical order

  1. … 7 more files in changeset.
Property Reform Part 2: better handling of per-object properties nsf.c: - changed "/class/ __objectconfigure" to "/obj/ __objectconfigure" to be able to handle per-object properties on classes properly. - renamed "info method parametersyntax" -> "info method syntax" - renamed "/obj|cls/ info method parametersyntax" into "/obj|cls/ info method syntax" - replaced "::nsf::methods::class::info::objectparameter" by "::nsf::methods::object::info::objectparameter" - new command "::nsf::parameter::specs ?-configure? ?-noposargs? slotobjs": convert provided slotobjs into a list of parameter specs - new command "::nsf::parameter::get list|name|syntax parameterspec": convert parameter spec into syntax form, or retrieve pieces of information from it (can be extended in the future) - added more or less generic list handling functions TclObjListFreeList(), TclObjListNewElement() and TclObjListAdd() used by "::nsf::parameter::specs" - replaced "::nsf::method::property /obj/ -per-object /name/ slotcontainer ?value?" by "::nsf::object::property /obj/ slotcontainer ?value?" - added "::nsf::object::property /obj/ hasperobjectslots ?value?"

nx.tcl:

- new info methods

* "/obj/ info lookup parameter definitions"

* "/obj/ info lookup parameter names"

* "/obj/ info lookup parameter list"

* "/obj/ info lookup parameter syntax"

- changed "/cls/ info parameter definition ?name?"

into "/cls/ info parameter definitions ?name?"

since ir returns a list. Still, "list" or "syntax" won't

be plural

  1. … 18 more files in changeset.
nsf.c: - fixed parmeter syntax for required nonpos args - deactivate deletion of methods via nsf::object::delete during shutdown to avoid missing slot forwarders called from destructors

  1. … 5 more files in changeset.
nx.tcl: - rename the following internally called methods (not for XOTcl). alloc -> __alloc dealloc -> __dealloc objectparameter -> __objectparameter recrate -> __recreate - from these methods, only __objectparameter is defined per default, the others are defined on demand

  1. … 6 more files in changeset.
- remove debug output

- deacitivate for the time being allowmethoddispatch (make it behave always like true) - added instead new flag "perobjectdispatch" to make behavior of ensembleobjects configurable. - The behavior for keepcallerself is currently only activated for the method-interface for object dispatch, since otherwise the following would be dangerous, since "o2 foo" would destroy o2 nx::Object create o1 nsf::object::property o1 keepcallerself true nx::Object create o2 { ::public method foo {} {o1 destroy} } o2 foo

  1. … 10 more files in changeset.
- nsf.c: start all error messages with a lower case word for consistency and to follow closer to Tcl's conventions

  1. … 14 more files in changeset.
- alias reform: instead of calling first an alias with a stack frame followed by the dispatched of the aliased cmd, resolve aliases internally in dispatch. This has the advantage that we do not have to ignore the "transparent" stack frame in some sitations, and we have much less problems with the names of the aliased cmds (e.g. objects) in the introspection methods. Additionally, several problem cases disappeared from the regression test cases. In addition, the new approach is faster. - eliminating obsolete flag NSF_CSC_CALL_IS_TRANSPARENT

  1. … 9 more files in changeset.
- simplified usage of ObjectName() and ClassName() macros (no caller parenthesis needed) - added exerpimental object property keepcaller self (currently only evaluated by aliased objects)

  1. … 8 more files in changeset.
- make sure to use "XOTcl 2.0" instead of just XOTcl in "package req" to avoid confusions due to beta state - remove more obsolete and untested files

  1. … 56 more files in changeset.
tests: - added "package prefer latest" to avoid confusions of alpha and beta releases with install versions

  1. … 12 more files in changeset.
- nsf.c - added experimental parameter option noleadingdash - additionalal regression test file method-parameter.test - provide selective error messages for unknown nonpos args

  1. … 11 more files in changeset.
- reduce verbosity

  1. … 1 more file in changeset.
- generic/nsfAPI.h: Renamed the [::nsf::current next] subcommand to [::nsf::current nextmethod] - library/xotcl/library/xotcl2.tcl: Accordingly, the xotcl::self emulation maps [self next] to [current nextmethod] - tests/disposition.test, tests/methods.test, tests/submethods.test, tests/tcloo.test: Changed the few occurrences of [current next] to [current nextmethod] - tests/introspection.test: Added some basic tests on the expected behaviour of [::nsf::current nextmethod]

  1. … 8 more files in changeset.
- nsf.c: * integrated "-local" and fully qualified handling with ObjectDispatch to ensure proper behavior of mixins/next etc. * added "/obj/ -local ..." similar to "/obj/ -system ..." * added "nsf::object::disapatch /obj/ -local ..." similar to "/obj/ -local ..." * extended regression test (next from -local, fully qualified names, private methods, "...dispatch -local")

  1. … 8 more files in changeset.
- nx.tcl * renamed "attribute" to "property" * renamed "defaultAttributeCallProtection" to "defaultPropertyCallProtection" * renamed "nx::Attribute" to ""nx::VariableSlot" * renamed "BootStrapAttributeSlot" to "BootStrapVariableSlot" * renamed "createBootstrapAttributeSlots" to "createBootstrapVariableSlots" * removed method attributes * implemented old attributes definition in xotcl2 as method "parameter"

  1. … 32 more files in changeset.
-nsf.c: * move to greedy assert to an inner scope ("info method ...") * allow testwise "switch" as object parameter (when it is used, accessors are deactivated for this attribute) * extended regression test

  1. … 5 more files in changeset.
- tests/disposition.test: Corrected a temporarily silenced test, the dispo test suite now runs completely

  1. … 1 more file in changeset.
- fix typos

- disposition.test: replace "exit" by an "if 0 {...}" for the time being

  1. … 1 more file in changeset.
- generic/nsf.c / NextSearchAndInvoke(): Prior to this commit, next calls from within submethod leaves resulted in the interp's unknown flag to be set. While for dispatches without filter indirection this remains hidden and unnoticed, registered filters triggered an unwanted unknown dispatch in such scenarios. Consequently, such leaf next's in submethods behaved differently from the method equivalents. The patch identifies such leaf-next dispatches by watching out for a characteristic callstack structure. - tests/submethods.test: Add a characteristic test for the above patch. - tests/disposition.test: Some cleanup ...

  1. … 2 more files in changeset.
- nx.tcl: * added support for "variable" on the class-level * added flag "noconfig" to object parameter options * parameters with "noconfig" are omitted in "info parameter syntax" and "info parameter list" * used switches for all configurable boolean options for "variable" and "attribute" * regularized the interface of "variable" and "attribute" * extended regression test

  1. … 5 more files in changeset.
- generic/nsf.c: Fixed [current callingmethod] for submethods (i.e., reporting submethods as calling methods, including their methodpath). Added tests covering the fix (see tests/submethods.test). - generic/nsfStack.c (CallStackMethodPath): Re-arranged the traversal slightly, to escape non-ensemble frames (eval CFRAMEs) as parts of the method path. Added test (see tests/submethods.test). - library/nx/nx.tcl: Corrected the impl of Ensemble->defaultmethod() (e.g., used self instead of current) - tests/disposition.test: Fixed test cases turned out to be false positives. Before the fixes, [current methodpath] gave non-empty results for simple object aliases.

  1. … 4 more files in changeset.
- first draft of separation of attribute -> variable + accessor

  1. … 4 more files in changeset.
- TODO: Added an entry concerning callstack introspection (as discussed today) - generic/nsf.c: Some minor renaming in NsfOConfigureMethod(); made sure that intermediate frames resulting from forward-parameter dispatches are equally marked INACTIVE. - tests/disposition.test: Added tests covering uplevel/upvar support under parameter/disposition dispatches (i.e., uplevel and upvar calls from within parameter-dispatched methods); the tests also cover XOTcl's residualargs dispatches.

  1. … 3 more files in changeset.
Squashed commit of the following:

commit 901efa4cb4e1bbd55a8c47ebb79f4c7b4b397668

Author: ssoberni <stefan.sobernig@wu-wien.ac.at>

Date: Wed Jul 6 17:51:38 2011 +0200

- generic/nsf.c: Provide the [current class] context to submethods

- tests/disposition.test: Added some tests on the interaction of

INACTIVE frames (mixin, filter) and submethods

- tests/submethods.test: Testing [current class] context for submethods

  1. … 3 more files in changeset.