slottest.xotcl

Clone Tools
  • last updated 19 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
avoid overly short method names

  1. … 1 more file in changeset.
improve spelling

  1. … 4 more files in changeset.
improve spelling

  1. … 5 more files in changeset.
xotcl1 compatibility: preserve overwritte slot accessor methods via instprocs

many thanks to Zoran for indicating this

  1. … 1 more file in changeset.
Fix typos

  1. … 63 more files in changeset.
xotcl2: - added "-returns" flag to XOTcl's instprocs/procs and methods, very similar to "-returns" in nx - extended serializer to handle "-returns" flag - extended regression test

  1. … 3 more files in changeset.
Slot trace reform: - redesign of slot interface of traces from * variables contains cmds and variable references to * slot specific methods with the same interface as slot-setters - new: * specify flag "-trace" with a list of values "get", "set", "default" * when flag is set, a trace will be registered calling methods value=get obj variable value=set obj variable value value=default obj variable on the slot (actually the first two are identical with the methods used for slot-defined accessors) - updated regression test * new flag "-notrace" for "nsf::var::set" and "nsf::var::get"

  1. … 9 more files in changeset.
serializer: - added handling of "-debug" and "-deprecated" in serializer - allow export of nsfprocs via "exportMethods declaration" in order to keep otherwise excluded cmds in the result. this allows us to keep nsf::debug::* or nsf::deprecated definitions in the blueprint in OpenACS. - hardened serializer (use e.g. "::namespace" instead of "namespace" when there is a potential conflict with a method named "namespace", prefer nsf::directdispatch, etc.) - extended regression test

  1. … 3 more files in changeset.
nsf.c, gentclAPI.tcl: - new argument types "virtualobjectargs" and "virtualclassargs" for context-specific argument resolutions: when a context object is provided, arguments of type "virtualobjectargs" are determined based on the slots applicable for the object (like "... lookup ..."), arguments of type "virtualclassargs" are resolved against a class. These types are used as follows: /obj/ configure /virtualobjectargs/ /cls/ create /name/ /virtualclassargs/ /cls/ recreate /name/ /virtualclassargs/ /cls/ new ?-childof /obj/? /virtualclassargs/ This new feature allows us to provide better error messages and to make much of the "... info ... configure parameter ..." infrastructure much less important. - For "virtualclassargs" we need the functionality to obtain from the C-Code based on a class the configure parameters applicable to objects of this class. - add argument "-context ..." to "cmd::info" to pass the context object (so far the only place where the context-object is used) - object system configuration parameters changes: new: -class.configureparameter new: -object.configureparameter removed: -class.objectparameter

  1. … 16 more files in changeset.
xotcl2: - use value=set instead of value=assign - simplify "-parameter" implementation - add setters for "name", "domain", and "default" to xotcl::Attribute for backward compatibility

  1. … 4 more files in changeset.
nx.tcl, xotcl2.tcl: - use value=* as names for interally called and forwarder-called accessor methods - disallow "assign" for nx::variableSlots

  1. … 12 more files in changeset.
nx.tcl: - remove setter methods from BootstrapVariableSlots - reducing interface of BootstrapVariableSlots by setting methods protected

  1. … 5 more files in changeset.
- finalize dropping of setter methods for nx

  1. … 9 more files in changeset.
nsf.c: - change name of enumeratorConverterEntry to Nsf_EnumeratorConverterEntry, move it with NSF_ARG_* flags to tcl.h to make it available in derived modules using the converter - Added editor hints for a more uniform appearance

  1. … 44 more files in changeset.
xotcl2: - fixed "... info defaults ..." and "... info instdefaults ..." emulation in XOTcl 2 - fixed error message - extended regression test - bumped revision of nsf/xotcl/nx to 2.0b6

  1. … 9 more files in changeset.
nx::test: - change test cases to newer interface - don't use "namespace import nx::*" in test cases when not required

  1. … 34 more files in changeset.
- when creation with an required configure parameter failed, delete the half-baked object to avoid confusing states.

  1. … 4 more files in changeset.
- 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.
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.
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.
- 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.
Most issues resolved, however, the ordering of default vs. traces is pending

  1. … 4 more files in changeset.
- library/xotcl/library/xotcl2.tcl: Provided a virtual slot "multivalued" to establish backward compatibility with XOTcl1; also, allow old-style class creation based on unknown for ::xotcl::Attribute - library/xotcl/tests/slottest.xotcl: Added some tests on backward compatibility for XOTcl slots

  1. … 1 more file in changeset.
Fixed test case statement

- library/xotcl/library/xotcl2.tcl: Provided a virtual slot "multivalued" to establish backward compatibility with XOTcl1 - library/xotcl/tests/slottest.xotcl: Added some tests on backward compatibility for XOTcl slots

  1. … 1 more file 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.
- 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.
- 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.