parameters.test

Clone Tools
  • last updated 4 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
- added functiality for "cget" to call parameter-methods (e.g. "... cget -class"). The method cget calls either "/slot/ get ..." (when slot=... is provided in the parameter spec) or it assumes that the method without argument returns the value - added "::nsf::object::property /obj/ volatile" to query whether a object is volatile or not - "/obj/ cget -volatile" returns now the volatial state of the object - factored out ParameterMethodDispatch() from OConfigureMethod() - extended regression test

  1. … 9 more files in changeset.
- invalidation of per-object parameter cache * on mixin changes and * on deletion/adding of per-object slots - decactivate PER_OBJECT_PARAMETER_CACHING per default (flipping this parameter makes regression test more than 20 faster). - extended regression test

  1. … 4 more files in changeset.
- NsfObjInfoObjectparameterMethod(): return not only the first matching parameter, but the list of all matching ones. The last optional argument was renamed from "name" to "pattern" accordingly

  1. … 6 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.
nsf.c: - fix potential bad interaction between per-object mixins and per-class caching of object-parameters

  1. … 2 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.
- generalize handling for per-object-properties

  1. … 3 more files in changeset.
Property reform part 1:

- disallow protection modifiers for "properties" and

add new flag "-accessor" to "property" and "variable"

This changes definitions like

Class create C {

:property {a a1}

:public property {b b1}

:protected property {c c1}

:private property {d d1}

}

to

Class create C {

:property {a a1}

:property -accessor public {b b1}

:property -accessor protected {c c1}

:property -accessor private {d d1}

}

since "properties" are always public accessible

over the "configure" and "cget" interface, but the

accessors methods might not be public. The value of

the accessor might be also "none" (specifying explicitely

that no accessor is wanted) or "", which means: use the default.

Same holds for "variable"

- disallow parameter option "incremental" and change it to a flag

of the property or variable. The motivation for this is due to

the fact, that "incremental" is a property of the accessor, and

not of the value.

old:

Class create C {

:property foo:int,incremental

:variable bar:int,incremental

}

new:

Class create C {

:property -incremental foo:int

:variable -incremental bar:int

}

- disallow "public class property" and friends since these are not needed

- removed parameter property "noaccessor"

- removed "nx::configure defaultPropertyCallProtection" and

method hook "__default_property_call_protection"

- introduced "nx::configure defaultAccessor" and

method hook "__default_accessor"

- for the time being, "defaultAccessor" is "public" for NX and XOTcl,

will be changed to "none" in NX

- extended regression test (new file properties.test)

  1. … 16 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.
- rename nx::Object.configure to nx::Object.__configure to free method name "configure" for an e.g. tk-like configure

  1. … 5 more files in changeset.
nx.tcl: - set multiplicty for mixins and filters by default from 1..n to 0..n to avoid error messages, when e.g. empty mixin lists are configured. Setting emtpy mixin-lists is strictly speaking not necessary, but this eases the code in cases the lists are sometimes empty.

  1. … 3 more files in changeset.
Adding a test case and a preliminary fix for the parameter option interactions

  1. … 1 more file in changeset.
- library/nx/nx.tcl: Following the code review, implemented a first scheme for handling traces in setCheckedInstVar. This gives us consistent behavior for defaults and traces (valuechangedcmd) across classes and objects. - tests/parameters.test: Adjusted the relevant tests - Pending: setCheckedInstVar currently uses ::nsf::is to validate the value (e.g., default value) to be set. However, it might get passed parameter options which do not fit the NSF_DISALLOWED_ARG_VALUECHECKED filter.

  1. … 1 more file in changeset.
- Addressed a number of issues in the NX slot infrastructure (which revealed themselves when running Mark's BusinessActivities implementation in XOTcl2 mode): - generic/nsf.c: Initcmd blocks (as set for registering per-class slot traces) were subjected to argument checks causing unexpected behavior (e.g., attempts of unboxing initcmds as Tcl lists or of checking initcmds against value types). This was fixed by exempting NSF_ARG_INITCMD params from argument checking in ArgumentCheck() explicitly. - library/nx/nx.tcl: For per-class parameters, the use of valuechangedcmd effectively overruled the default value specified (simply because the generated initcmd holding the trace statements took the place of the default value). While for defaultcmd and for valuecmd the parallel use of default is forbidden, the valuechangedcmd semantics allow for specifying a default, in principle. This was fixed by providing a default-setting statement in the initcmd. - tests/parameters.test: Added tests to cover the above (and beyond). - library/xotcl/library/xotcl2.tcl: Extended the backwards compatibility of the hybrid XOTcl2/NX slots infrastructure to the XOTcl 1 interface: This includes support for inline -proc statements and instvar. This compat level corresponds to the slot interface as documented (by examples) in the XOTcl language ref and the manual. - library/xotcl/tests/slottest.xotcl: Added tests for the above compat enhancements.

  1. … 4 more files in changeset.
The BA examples are operative

  1. … 1 more file in changeset.
Most issues resolved, however, the ordering of default vs. traces is pending

  1. … 4 more files in changeset.
- added a SlotContainerCmdResolver() to avoid interaction of slot names with names of callable tcl commands. Without the SlotContainerCmdResolver() the call to "list" in a property named "list" leads to a call to the container object ::Test2::slot::list instead to the intended ::list. The implementation is not perfect, since it ignores the namespace path inside the slot container. - added regression test.

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

  1. … 6 more files in changeset.
- implement escaping for comma in value of parameter options: escaping in values can be achived via duplicating the comma. - extend regression test

  1. … 2 more files in changeset.
- pass property name to slot "initialize" method to conform with the interface to "assign", "get" ... (all these receive the property name as well) - allow slot "initialize" method to be protected (handled similarly to "init")

  1. … 3 more files in changeset.
nsf.c: - added object parameter option "slotinitialize" - renamed object parameter option "invokesetter" -> "slotassign" - call slot.assign instead of setter of object - removed restriction on nosetter/invokesetter: nosetter can be used in connection with slotassign - added regression test for slot.initialize

  1. … 4 more files in changeset.
- treating incompatible forwarding to slot vs. slot option noaccessor - extended regression test

  1. … 2 more files in changeset.
- Forward setting of object parameters to the slot object, when assign method is user-defined on the slot object - Cleanup and extend regression test

  1. … 3 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.
- generic/nsf.c: DispatchUnknownMethod() In the re-entrant case, the unknown dispatcher was too greedy by skipping the first element in the objv at basically all times. For CallConfigureMethod() case in XOTcl2, the actual method name was so skipped. Generally speaking, the "skipping rules" in DispatchUnknownMethod() feel a touch too particular to me: For instance, the dispatch flag "-local", "-system" etc. must be handled. Also, unknowns in method ensembles have the unknown method listed first in objv. Alternatively, we might review how objc/objv make it into DispatchUnknownMethod() (there are just two call sites). But this would merely shift/spread the skipping. Changing the arg vectors, to begin with, (e.g. removing "-local", "-system", etc. from the objv) would requiring rebuilding the arg vector. - tests/parameters.test: Added a simplistic test case to catch the error reporting for XOTcl 2's residualargs handling.

  1. … 1 more file 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.
- rename "info method handle /methodName/" into "info method registrationhandle /methodName/" - rename "info method origin /methodName/" into "info method definitionhandle /methodName/" - added "info method origin" to return the target of an alias (or empty)

  1. … 19 more files in changeset.
- altered default handling to honor side effects of aliased object parameters. This slows down evaluation a little. Side-effects from aliased parameters are discouraged, since the order of the evaluation should not matter of an declarative evaluation of the argument vector. - extended regression test

  1. … 2 more files in changeset.
nonleadingdash handling: - doc: added "nonleadingdash" to UML class diagramm - nsf.c: added error message, when "noleadingdash" is used on non-positional parameters - nsf.c: use same logic for "nonleadingdash" to "value in argument" - nsf.c: deactivated rudimentary unknown handler for the time being - nx.tcl: added handling of parameter option "noleadingdash" in objectParameterSlots

  1. … 6 more files in changeset.